MCPcopy
hub / github.com/microsoft/playwright-python / handler

Function handler

tests/async/test_page_add_locator_handler.py:32–38  ·  view source on GitHub ↗
(locator: Locator)

Source from the content-addressed store, hash-verified

30 original_locator = page.get_by_text("This interstitial covers the button")
31
32 async def handler(locator: Locator) -> None:
33 assert locator == original_locator
34 nonlocal before_count
35 nonlocal after_count
36 before_count += 1
37 await page.locator("#close").click()
38 after_count += 1
39
40 await page.add_locator_handler(original_locator, handler)
41

Callers

nothing calls this directly

Calls 4

clickMethod · 0.45
locatorMethod · 0.45
is_visibleMethod · 0.45
get_by_textMethod · 0.45

Tested by

no test coverage detected