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

Function test_strict_mode

tests/async/test_frames.py:287–298  ·  view source on GitHub ↗
(page: Page, server: Server)

Source from the content-addressed store, hash-verified

285
286
287async def test_strict_mode(page: Page, server: Server) -> None:
288 await page.goto(server.EMPTY_PAGE)
289 await page.set_content(
290 """
291 <button>Hello</button>
292 <button>Hello</button>
293 """
294 )
295 with pytest.raises(Error):
296 await page.text_content("button", strict=True)
297 with pytest.raises(Error):
298 await page.query_selector("button", strict=True)

Callers

nothing calls this directly

Calls 4

gotoMethod · 0.45
set_contentMethod · 0.45
text_contentMethod · 0.45
query_selectorMethod · 0.45

Tested by

no test coverage detected