Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix stale tests

Nick Sweeting503eb97be798
diff --git a/browser_use/browser/tests/test_clicks.py b/browser_use/browser/tests/test_clicks.py
index e3b97122f..c85faee2c 100644
--- a/browser_use/browser/tests/test_clicks.py
+++ b/browser_use/browser/tests/test_clicks.py
@@ -49,7 +49,7 @@ async def test_highlight_elements():
while True:
try:
# await asyncio.sleep(10)
- state = await context.get_state(True)
+ state = await context.get_state_summary(True)
async with await anyio.open_file('./tmp/page.json', 'w') as f:
await f.write(
diff --git a/browser_use/dom/tests/extraction_test.py b/browser_use/dom/tests/extraction_test.py
index 78af0507f..c7491ea4d 100644
--- a/browser_use/dom/tests/extraction_test.py
+++ b/browser_use/dom/tests/extraction_test.py
@@ -97,7 +97,7 @@ async def test_focus_vs_all_elements():
# Get/refresh the state (includes removing old highlights)
print('\nGetting page state...')
- all_elements_state = await context.get_state(True)
+ all_elements_state = await context.get_state_summary(True)
selector_map = all_elements_state.selector_map
total_elements = len(selector_map.keys())