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
fixed action param xpath test
Gregor Žuničd64913c76a52
diff --git a/examples/models/gemini.py b/examples/models/gemini.pyindex fbb660246..9a48939b1 100644--- a/examples/models/gemini.py+++ b/examples/models/gemini.py@@ -20,7 +20,7 @@ api_key = os.getenv('GOOGLE_API_KEY')if not api_key:raise ValueError('GOOGLE_API_KEY is not set')-llm = ChatGoogle(model='gemini-2.0-flash-exp', api_key=api_key)+llm = ChatGoogle(model='gemini-2.5-flash', api_key=api_key)browser_session = BrowserSession(browser_profile=BrowserProfile(@@ -32,7 +32,7 @@ browser_session = BrowserSession(async def run_search():agent = Agent(- task='Go to amazon.com, search for laptop, sort by best rating, and give me the price of the first result',+ task='Go to google.com/travel/flights and find the cheapest flight from New York to Paris on 2025-07-15',llm=llm,max_actions_per_step=4,browser_session=browser_session,diff --git a/tests/ci/test_action_parameter_injection.py b/tests/ci/test_action_parameter_injection.pyindex 98a0e97e3..204edc452 100644--- a/tests/ci/test_action_parameter_injection.py+++ b/tests/ci/test_action_parameter_injection.py@@ -131,6 +131,7 @@ class TestBrowserContext:Test the _enhanced_css_selector_for_element method to verify thatit returns the correct CSS selector string for a DOMElementNode."""+# Create a DOMElementNode instance with a complex set of attributesdummy_element = EnhancedDOMTreeNode(node_id=1,@@ -154,9 +155,7 @@ class TestBrowserContext:actual_selector = BrowserSession._enhanced_css_selector_for_element(dummy_element, include_dynamic_attributes=True)# Expected conversion includes the xpath conversion, class attributes, and other attributes- expected_selector = (- 'html > body > div:nth-of-type(2).foo.bar[id="my-id"][placeholder*="some \\"quoted\\" text"][data-testid="123"]'- )+ expected_selector = 'div.foo.bar[id="my-id"][placeholder*="some \\"quoted\\" text"][data-testid="123"]' # changed the test because we have slightly different dom logic nowassert actual_selector == expected_selector, f'Expected {expected_selector}, but got {actual_selector}'@pytest.mark.asyncio