MCPcopy Index your code
hub / github.com/microsoft/playwright-python / handler

Function handler

tests/sync/test_page_add_locator_handler.py:31–37  ·  view source on GitHub ↗
(locator: Locator)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected