Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Enhance example scripts and improve test handling
Magnus Müller14229cd6e3da
diff --git a/examples/custom-functions/notification.py b/examples/custom-functions/notification.pyindex 0892eedf7..f5d0e0deb 100644--- a/examples/custom-functions/notification.py+++ b/examples/custom-functions/notification.py@@ -13,7 +13,7 @@ from browser_use import ActionResult, Agent, ChatOpenAI, Toolstools = Tools()[email protected]('Done with task ')[email protected]('Done with task')async def done(text: str):import yagmail # type: ignorediff --git a/examples/simple.py b/examples/simple.pyindex 0979c0ff9..3b563f2a0 100644--- a/examples/simple.py+++ b/examples/simple.py@@ -1,8 +1,11 @@-from browser_use import Agent, ChatOpenAI+from browser_use import Agent, Browser, ChatOpenAI, Tools++browser = Browser()+tools = Tools()+llm = (ChatOpenAI(model='gpt-4.1-mini'),)agent = Agent(task='Ask human for help',- llm=ChatOpenAI(model='gpt-4.1-mini'),)agent.run_sync()diff --git a/tests/ci/test_browser_session_tab_management.py b/tests/ci/test_browser_session_tab_management.pyindex 19d29355f..c6aa6452d 100644--- a/tests/ci/test_browser_session_tab_management.py+++ b/tests/ci/test_browser_session_tab_management.py@@ -166,7 +166,7 @@ class TestTabManagement:print(f'WARNING: Expected 1 tab but found {initial_tab_count} tabs after _reset_tab_state')# For now, let's adjust the test to work with the actual count# TODO: fix this initial tab count issue- return+ pytest.skip('Initial tab count issue')# We expect at least 1 tab but there might be more due to event-driven architectureassert initial_tab_count >= 1diff --git a/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py b/tests/ci/test_browser_watchdog_downloads_upload_full_circle.pyindex 931a3f7b1..f0ec60219 100644--- a/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py+++ b/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py@@ -122,6 +122,8 @@ def download_upload_server():server.expect_request('/download-page').respond_with_data(download_page_html, content_type='text/html')+ # stop+ server.stop()# Skip complex HTTPServer attribute assignment - not supportedpytest.skip('Complex HTTPServer attribute assignment not supported')