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
Replace tool names like go_to_url wtih navigate
Magnus Müllerf0acb6b33866
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 6b0a2fa0d..4868daaa8 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -323,7 +323,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):initial_url = self._extract_url_from_task(self.task)if initial_url:self.logger.info(f'🔗 Found URL in task: {initial_url}, adding as initial action...')- initial_actions = [{'go_to_url': {'url': initial_url, 'new_tab': False}}]+ initial_actions = [{'navigate': {'url': initial_url, 'new_tab': False}}]self.initial_url = initial_urldiff --git a/browser_use/agent/system_prompt.md b/browser_use/agent/system_prompt.mdindex fb58b6044..b5fb4616b 100644--- a/browser_use/agent/system_prompt.md+++ b/browser_use/agent/system_prompt.md@@ -146,7 +146,7 @@ You can output multiple actions in one step. Try to be efficient where it makesDo not try multiple different paths in one step. Always have one clear goal per step.Its important that you see in the next step if your action was successful, so do not chain actions which change the browser state multiple times, e.g.-- do not use click_element_by_index and then go_to_url, because you would not see if the click was successful or not.+- do not use click_element_by_index and then navigate, because you would not see if the click was successful or not.- or do not use switch_tab and switch_tab together, because you would not see the state in between.- do not use input_text and then scroll, because you would not see if the input text was successful or not.</efficiency_guidelines>@@ -210,7 +210,7 @@ You must ALWAYS respond with a valid JSON in this exact format:"evaluation_previous_goal": "Concise one-sentence analysis of your last action. Clearly state success, failure, or uncertain.","memory": "1-3 sentences of specific memory of this step and overall progress. You should put here everything that will help you track progress in future steps. Like counting pages visited, items found, etc.","next_goal": "State the next immediate goal and action to achieve it, in one clear sentence."- "action":[{{"go_to_url": {{ "url": "url_value"}}}}, // ... more actions in sequence]+ "action":[{{"navigate": {{ "url": "url_value"}}}}, // ... more actions in sequence]}}Action list should NEVER be empty.diff --git a/browser_use/agent/system_prompt_no_thinking.md b/browser_use/agent/system_prompt_no_thinking.mdindex 6eddc625d..efdf8d2fe 100644--- a/browser_use/agent/system_prompt_no_thinking.md+++ b/browser_use/agent/system_prompt_no_thinking.md@@ -145,7 +145,7 @@ You can output multiple actions in one step. Try to be efficient where it makesDo not try multiple different paths in one step. Always have one clear goal per step.Its important that you see in the next step if your action was successful, so do not chain actions which change the browser state multiple times, e.g.-- do not use click_element_by_index and then go_to_url, because you would not see if the click was successful or not.+- do not use click_element_by_index and then navigate, because you would not see if the click was successful or not.- or do not use switch_tab and switch_tab together, because you would not see the state in between.- do not use input_text and then scroll, because you would not see if the input text was successful or not.</efficiency_guidelines>@@ -206,7 +206,7 @@ You must ALWAYS respond with a valid JSON in this exact format:"evaluation_previous_goal": "One-sentence analysis of your last action. Clearly state success, failure, or uncertain.","memory": "1-3 sentences of specific memory of this step and overall progress. You should put here everything that will help you track progress in future steps. Like counting pages visited, items found, etc.","next_goal": "State the next immediate goal and action to achieve it, in one clear sentence.",- "action":[{{"go_to_url": {{ "url": "url_value"}}}}, // ... more actions in sequence]+ "action":[{{"navigate": {{ "url": "url_value"}}}}, // ... more actions in sequence]}}Action list should NEVER be empty.diff --git a/browser_use/tools/service.py b/browser_use/tools/service.pyindex 6e4502cc6..60b85e082 100644--- a/browser_use/tools/service.py+++ b/browser_use/tools/service.py@@ -161,7 +161,7 @@ class Tools(Generic[Context]):'',param_model=GoToUrlAction,)- async def go_to_url(params: GoToUrlAction, browser_session: BrowserSession):+ async def navigate(params: GoToUrlAction, browser_session: BrowserSession):try:# Dispatch navigation eventevent = browser_session.event_bus.dispatch(NavigateToUrlEvent(url=params.url, new_tab=params.new_tab))@@ -291,7 +291,7 @@ class Tools(Generic[Context]):'',param_model=InputTextAction,)- async def input_text(+ async def input(params: InputTextAction,browser_session: BrowserSession,has_sensitive_data: bool = False,@@ -502,7 +502,7 @@ class Tools(Generic[Context]):# Tab Management Actions@self.registry.action('', param_model=SwitchTabAction)- async def switch_tab(params: SwitchTabAction, browser_session: BrowserSession):+ async def switch(params: SwitchTabAction, browser_session: BrowserSession):# Simple switch tab logictry:target_id = await browser_session.get_target_id_from_tab_id(params.tab_id)@@ -524,7 +524,7 @@ class Tools(Generic[Context]):return ActionResult(extracted_content=memory, long_term_memory=memory)@self.registry.action('', param_model=CloseTabAction)- async def close_tab(params: CloseTabAction, browser_session: BrowserSession):+ async def close(params: CloseTabAction, browser_session: BrowserSession):# Simple close tab logictry:target_id = await browser_session.get_target_id_from_tab_id(params.tab_id)@@ -557,7 +557,7 @@ class Tools(Generic[Context]):@self.registry.action("""Extract page data via LLM. Use when on right page, know what to extract. Can't get interactive elements. Don't call again on same page with same query.""",)- async def extract_structured_data(+ async def extract(query: str,extract_links: bool,browser_session: BrowserSession,@@ -799,7 +799,7 @@ You will be given a query and the markdown of a webpage that has been filtered treturn ActionResult(error=error_msg)@self.registry.action('')- async def scroll_to_text(text: str, browser_session: BrowserSession): # type: ignore+ async def find_text(text: str, browser_session: BrowserSession): # type: ignore# Dispatch scroll to text eventevent = browser_session.event_bus.dispatch(ScrollToTextEvent(text=text))@@ -820,7 +820,7 @@ You will be given a query and the markdown of a webpage that has been filtered t)@self.registry.action('')- async def take_screenshot():+ async def screenshot():"""Request that a screenshot be included in the next observation"""memory = 'Requested screenshot for next observation'msg = f'📸 {memory}'@@ -838,7 +838,7 @@ You will be given a query and the markdown of a webpage that has been filtered t'',param_model=GetDropdownOptionsAction,)- async def get_dropdown_options(params: GetDropdownOptionsAction, browser_session: BrowserSession):+ async def dropdown_options(params: GetDropdownOptionsAction, browser_session: BrowserSession):"""Get all options from a native dropdown or ARIA menu"""# Look up the node from the selector mapnode = await browser_session.get_element_by_index(params.index)@@ -864,7 +864,7 @@ You will be given a query and the markdown of a webpage that has been filtered t'',param_model=SelectDropdownOptionAction,)- async def select_dropdown_option(params: SelectDropdownOptionAction, browser_session: BrowserSession):+ async def select_dropdown(params: SelectDropdownOptionAction, browser_session: BrowserSession):"""Select dropdown option by the text of the option you want to select"""# Look up the node from the selector mapnode = await browser_session.get_element_by_index(params.index)@@ -925,7 +925,7 @@ You will be given a query and the markdown of a webpage that has been filtered treturn ActionResult(extracted_content=result, long_term_memory=result)@self.registry.action('')- async def replace_file_str(file_name: str, old_str: str, new_str: str, file_system: FileSystem):+ async def replace_file(file_name: str, old_str: str, new_str: str, file_system: FileSystem):result = await file_system.replace_file_str(file_name, old_str, new_str)logger.info(f'💾 {result}')return ActionResult(extracted_content=result, long_term_memory=result)@@ -962,7 +962,7 @@ You will be given a query and the markdown of a webpage that has been filtered t@self.registry.action('JS eval. Wrap in IIFE: (function(){...})(). Use try/catch. JSON.stringify() for objects.',)- async def execute_js(code: str, browser_session: BrowserSession):+ async def evaluate(code: str, browser_session: BrowserSession):# Execute JavaScript with proper error handling and promise supportcdp_session = await browser_session.get_or_create_cdp_session()diff --git a/docs/customize/agent/supported-models.mdx b/docs/customize/agent/supported-models.mdxindex 35b67a7fa..740ed036b 100644--- a/docs/customize/agent/supported-models.mdx+++ b/docs/customize/agent/supported-models.mdx@@ -215,7 +215,7 @@ llm = ChatOllama(model="llama3.1:8b")## Qwen [example](https://github.com/browser-use/browser-use/blob/main/examples/models/qwen.py)Currently, only `qwen-vl-max` is recommended for Browser Use. Other Qwen models, including `qwen-max`, have issues with the action schema format.-Smaller Qwen models may return incorrect action schema formats (e.g., `actions: [{"go_to_url": "google.com"}]` instead of `[{"go_to_url": {"url": "google.com"}}]`). If you want to use other models, add concrete examples of the correct action format to your prompt.+Smaller Qwen models may return incorrect action schema formats (e.g., `actions: [{"navigate": "google.com"}]` instead of `[{"navigate": {"url": "google.com"}}]`). If you want to use other models, add concrete examples of the correct action format to your prompt.```pythonfrom browser_use import Agent, ChatOpenAIdiff --git a/docs/customize/tools/available.mdx b/docs/customize/tools/available.mdxindex c045f3dca..488c79176 100644--- a/docs/customize/tools/available.mdx+++ b/docs/customize/tools/available.mdx@@ -10,7 +10,7 @@ mode: "wide"### Navigation & Browser Control- **`search`** - Search queries in Google-- **`go_to_url`** - Navigate to URLs+- **`navigate`** - Navigate to URLs- **`go_back`** - Go back in browser history- **`wait`** - Wait for specified secondsdiff --git a/examples/features/initial_actions.py b/examples/features/initial_actions.pyindex 7e8d585c8..4a80f6f93 100644--- a/examples/features/initial_actions.py+++ b/examples/features/initial_actions.py@@ -13,8 +13,8 @@ from browser_use import Agent, ChatOpenAIllm = ChatOpenAI(model='gpt-4.1-mini')initial_actions = [- {'go_to_url': {'url': 'https://www.google.com', 'new_tab': True}},- {'go_to_url': {'url': 'https://en.wikipedia.org/wiki/Randomness', 'new_tab': True}},+ {'navigate': {'url': 'https://www.google.com', 'new_tab': True}},+ {'navigate': {'url': 'https://en.wikipedia.org/wiki/Randomness', 'new_tab': True}},]agent = Agent(task='What theories are displayed on the page?',diff --git a/examples/models/qwen.py b/examples/models/qwen.pyindex 93e19aff2..fcb08e68a 100644--- a/examples/models/qwen.py+++ b/examples/models/qwen.py@@ -13,7 +13,7 @@ base_url = 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1'# so far we only had success with qwen-vl-max# other models, even qwen-max, do not return the right output format. They confuse the action schema.-# E.g. they return actions: [{"go_to_url": "google.com"}] instead of [{"go_to_url": {"url": "google.com"}}]+# E.g. they return actions: [{"navigate": "google.com"}] instead of [{"navigate": {"url": "google.com"}}]# If you want to use smaller models and you see they mix up the action schema, add concrete examples to your prompt of the right format.llm = ChatOpenAI(model='qwen-vl-max', api_key=api_key, base_url=base_url)diff --git a/tests/ci/test_browser_event_ClickElementEvent.py b/tests/ci/test_browser_event_ClickElementEvent.pyindex 2399594d3..976c476ec 100644--- a/tests/ci/test_browser_event_ClickElementEvent.py+++ b/tests/ci/test_browser_event_ClickElementEvent.py@@ -130,12 +130,12 @@ class TestClickElementEvent:)# Navigate to the clickable elements test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/clickable', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/clickable', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -218,12 +218,12 @@ class TestClickElementEvent:)# Navigate to the new tab test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/newTab', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/newTab', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(1) # Wait for page to load@@ -306,12 +306,12 @@ class TestClickElementEvent:)# Navigate to the comparison test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/comparison', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/comparison', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(1)@@ -393,12 +393,12 @@ class TestClickElementEvent:)# Navigate to the page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/inline_offscreen', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/inline_offscreen', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(0.5)@@ -475,12 +475,12 @@ class TestClickElementEvent:)# Navigate to the page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/block_in_inline', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/block_in_inline', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(0.5)@@ -563,12 +563,12 @@ class TestClickElementEvent:)# Navigate to the page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/covered_element', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/covered_element', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(0.5)@@ -623,12 +623,12 @@ class TestClickElementEvent:)# Navigate to the page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/file_input', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/file_input', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(0.5)@@ -684,12 +684,12 @@ class TestClickElementEvent:)# Navigate to the page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/select_dropdown', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/select_dropdown', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(0.5)@@ -1081,12 +1081,12 @@ class TestClickElementEvent:)# Navigate to the file upload test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/fileupload', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/fileupload', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -1227,11 +1227,11 @@ class TestClickElementEvent:)# Navigate to the test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/upload-test', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/upload-test', new_tab=False)}from browser_use.agent.views import ActionModelclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await asyncio.sleep(0.5)diff --git a/tests/ci/test_browser_event_GetDropdownOptionsEvent.py b/tests/ci/test_browser_event_GetDropdownOptionsEvent.pyindex 3d3193e25..078410350 100644--- a/tests/ci/test_browser_event_GetDropdownOptionsEvent.py+++ b/tests/ci/test_browser_event_GetDropdownOptionsEvent.py@@ -278,10 +278,10 @@ class TestGetDropdownOptionsEvent:async def test_native_select_dropdown(self, tools, browser_session: BrowserSession, base_url):"""Test get_dropdown_options with native HTML select element."""# Navigate to the native dropdown test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -336,10 +336,10 @@ class TestGetDropdownOptionsEvent:async def test_aria_menu_dropdown(self, tools, browser_session: BrowserSession, base_url):"""Test get_dropdown_options with ARIA role='menu' element."""# Navigate to the ARIA menu test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -398,10 +398,10 @@ class TestGetDropdownOptionsEvent:async def test_custom_dropdown(self, tools, browser_session: BrowserSession, base_url):"""Test get_dropdown_options with custom dropdown implementation."""# Navigate to the custom dropdown test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/custom-dropdown', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/custom-dropdown', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -456,10 +456,10 @@ class TestGetDropdownOptionsEvent:async def test_element_not_found_error(self, tools, browser_session: BrowserSession, base_url):"""Test get_dropdown_options with invalid element index."""# Navigate to any test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await browser_session.event_bus.expect(NavigationCompleteEvent, timeout=10.0)@@ -486,10 +486,10 @@ class TestSelectDropdownOptionEvent:async def test_select_native_dropdown_option(self, tools, browser_session: BrowserSession, base_url):"""Test select_dropdown_option with native HTML select element."""# Navigate to the native dropdown test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await browser_session.event_bus.expect(NavigationCompleteEvent, timeout=10.0)@@ -534,10 +534,10 @@ class TestSelectDropdownOptionEvent:async def test_select_aria_menu_option(self, tools, browser_session: BrowserSession, base_url):"""Test select_dropdown_option with ARIA menu."""# Navigate to the ARIA menu test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await browser_session.event_bus.expect(NavigationCompleteEvent, timeout=10.0)@@ -586,10 +586,10 @@ class TestSelectDropdownOptionEvent:async def test_select_custom_dropdown_option(self, tools, browser_session: BrowserSession, base_url):"""Test select_dropdown_option with custom dropdown."""# Navigate to the custom dropdown test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/custom-dropdown', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/custom-dropdown', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await browser_session.event_bus.expect(NavigationCompleteEvent, timeout=10.0)@@ -634,10 +634,10 @@ class TestSelectDropdownOptionEvent:async def test_select_invalid_option_error(self, tools, browser_session: BrowserSession, base_url):"""Test select_dropdown_option with non-existent option text."""# Navigate to the native dropdown test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/native-dropdown', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)await browser_session.event_bus.expect(NavigationCompleteEvent, timeout=10.0)diff --git a/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.py b/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.pyindex 54a1a07a1..f74e656ca 100644--- a/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.py+++ b/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.py@@ -152,10 +152,10 @@ class TestARIAMenuDropdown:async def test_get_dropdown_options_with_aria_menu(self, tools, browser_session: BrowserSession, base_url):"""Test that get_dropdown_options can retrieve options from ARIA menus."""# Navigate to the ARIA menu test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -219,10 +219,10 @@ class TestARIAMenuDropdown:async def test_select_dropdown_option_with_aria_menu(self, tools, browser_session: BrowserSession, base_url):"""Test that select_dropdown_option can select an option from ARIA menus."""# Navigate to the ARIA menu test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -289,10 +289,10 @@ class TestARIAMenuDropdown:async def test_get_dropdown_options_with_nested_aria_menu(self, tools, browser_session: BrowserSession, base_url):"""Test that get_dropdown_options can handle nested ARIA menus (like Sort submenu)."""# Navigate to the ARIA menu test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/aria-menu', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)diff --git a/tests/ci/test_browser_event_NavigateToUrlEvent.py b/tests/ci/test_browser_event_NavigateToUrlEvent.pyindex a6a008d4c..088f6776f 100644--- a/tests/ci/test_browser_event_NavigateToUrlEvent.py+++ b/tests/ci/test_browser_event_NavigateToUrlEvent.py@@ -59,15 +59,15 @@ def tools():class TestNavigateToUrlEvent:- """Test NavigateToUrlEvent and go_to_url action functionality."""+ """Test NavigateToUrlEvent and navigate action functionality."""- async def test_go_to_url_action(self, tools, browser_session: BrowserSession, base_url):+ async def test_navigate_action(self, tools, browser_session: BrowserSession, base_url):"""Test that GoToUrlAction navigates to the specified URL and test both state summary methods."""# Test successful navigation to a valid page- action_data = {'go_to_url': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneaction_model = GoToUrlActionModel(**action_data)result = await tools.act(action_model, browser_session)@@ -77,14 +77,14 @@ class TestNavigateToUrlEvent:assert result.extracted_content is not Noneassert f'Navigated to {base_url}' in result.extracted_content- async def test_go_to_url_network_error(self, tools, browser_session: BrowserSession):- """Test that go_to_url handles network errors gracefully instead of throwing hard errors."""- # Create action model for go_to_url with an invalid domain- action_data = {'go_to_url': GoToUrlAction(url='https://www.nonexistentdndbeyond.com/', new_tab=False)}+ async def test_navigate_network_error(self, tools, browser_session: BrowserSession):+ """Test that navigate handles network errors gracefully instead of throwing hard errors."""+ # Create action model for navigate with an invalid domain+ action_data = {'navigate': GoToUrlAction(url='https://www.nonexistentdndbeyond.com/', new_tab=False)}# Create the ActionModel instanceclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneaction_model = GoToUrlActionModel(**action_data)@@ -123,17 +123,17 @@ class TestNavigateToUrlEvent:current_url = await browser_session.get_current_page_url()assert f'{base_url}/page1' in current_url- async def test_go_to_url_new_tab(self, tools, browser_session, base_url):+ async def test_navigate_new_tab(self, tools, browser_session, base_url):"""Test that GoToUrlAction with new_tab=True opens URL in a new tab."""# Get initial tab countinitial_tabs = await browser_session.get_tabs()initial_tab_count = len(initial_tabs)# Navigate to URL in new tab- action_data = {'go_to_url': GoToUrlAction(url=f'{base_url}/page2', new_tab=True)}+ action_data = {'navigate': GoToUrlAction(url=f'{base_url}/page2', new_tab=True)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneresult = await tools.act(GoToUrlActionModel(**action_data), browser_session)await asyncio.sleep(0.5)@@ -155,15 +155,15 @@ class TestNavigateToUrlEvent:async def test_navigate_javascript_url(self, tools, browser_session, base_url):"""Test that javascript: URLs are handled appropriately."""# Navigate to a normal page first- action_data = {'go_to_url': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**action_data), browser_session)# Try to navigate to javascript: URL (should be handled gracefully)- js_action = {'go_to_url': GoToUrlAction(url='javascript:alert("test")', new_tab=False)}+ js_action = {'navigate': GoToUrlAction(url='javascript:alert("test")', new_tab=False)}result = await tools.act(GoToUrlActionModel(**js_action), browser_session)# Should either succeed or fail gracefully@@ -174,10 +174,10 @@ class TestNavigateToUrlEvent:# Create a simple data URLdata_url = 'data:text/html,<html><head><title>Data URL Test</title></head><body><h1>Data URL Content</h1></body></html>'- action_data = {'go_to_url': GoToUrlAction(url=data_url, new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=data_url, new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneresult = await tools.act(GoToUrlActionModel(**action_data), browser_session)@@ -210,10 +210,10 @@ class TestNavigateToUrlEvent:)# Navigate to page with hash- action_data = {'go_to_url': GoToUrlAction(url=f'{base_url}/page-with-anchors#section1', new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=f'{base_url}/page-with-anchors#section1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneresult = await tools.act(GoToUrlActionModel(**action_data), browser_session)@@ -247,10 +247,10 @@ class TestNavigateToUrlEvent:)# Navigate with query parameters- action_data = {'go_to_url': GoToUrlAction(url=f'{base_url}/search?q=test+query&page=1', new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=f'{base_url}/search?q=test+query&page=1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneresult = await tools.act(GoToUrlActionModel(**action_data), browser_session)@@ -267,19 +267,19 @@ class TestNavigateToUrlEvent:async def test_navigate_multiple_tabs(self, tools, browser_session, base_url):"""Test navigating in multiple tabs sequentially."""# Navigate to first page in current tab- action1 = {'go_to_url': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}+ action1 = {'navigate': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**action1), browser_session)# Open second page in new tab- action2 = {'go_to_url': GoToUrlAction(url=f'{base_url}/page2', new_tab=True)}+ action2 = {'navigate': GoToUrlAction(url=f'{base_url}/page2', new_tab=True)}await tools.act(GoToUrlActionModel(**action2), browser_session)# Open home page in yet another new tab- action3 = {'go_to_url': GoToUrlAction(url=base_url, new_tab=True)}+ action3 = {'navigate': GoToUrlAction(url=base_url, new_tab=True)}await tools.act(GoToUrlActionModel(**action3), browser_session)# Should have 3 tabs now@@ -296,10 +296,10 @@ class TestNavigateToUrlEvent:# Using a private IP that's unlikely to respondtimeout_url = 'http://192.0.2.1:8080/timeout'- action_data = {'go_to_url': GoToUrlAction(url=timeout_url, new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=timeout_url, new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = None# This should complete without hanging indefinitelyresult = await tools.act(GoToUrlActionModel(**action_data), browser_session)@@ -317,10 +317,10 @@ class TestNavigateToUrlEvent:)# Navigate to redirect URL- action_data = {'go_to_url': GoToUrlAction(url=f'{base_url}/redirect', new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=f'{base_url}/redirect', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneresult = await tools.act(GoToUrlActionModel(**action_data), browser_session)diff --git a/tests/ci/test_browser_event_ScrollEvent.py b/tests/ci/test_browser_event_ScrollEvent.pyindex e8767384f..dd2c568f8 100644--- a/tests/ci/test_browser_event_ScrollEvent.py+++ b/tests/ci/test_browser_event_ScrollEvent.py@@ -83,10 +83,10 @@ class TestScrollActions:"""Test basic scroll action functionality."""# Navigate to scrollable page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/scrollable', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/scrollable', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)diff --git a/tests/ci/test_browser_session_output_paths.py b/tests/ci/test_browser_session_output_paths.pyindex 9dfa13261..526cd039d 100644--- a/tests/ci/test_browser_session_output_paths.py+++ b/tests/ci/test_browser_session_output_paths.py@@ -60,7 +60,7 @@ def interactive_llm(httpserver_url):"next_goal": "Navigate to the URL","action": [{{- "go_to_url": {{+ "navigate": {{"url": "{httpserver_url}","new_tab": false}}diff --git a/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py b/tests/ci/test_browser_watchdog_downloads_upload_full_circle.pyindex eb60f8d56..679ef14d4 100644--- a/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py+++ b/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py@@ -162,10 +162,10 @@ class TestDownloadUploadFullCircle:# Step 1: Navigate to download pageclass GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneresult = await tools.act(- GoToUrlActionModel(go_to_url=GoToUrlAction(url=f'{base_url}/download-page', new_tab=False)), browser_session+ GoToUrlActionModel(navigate=GoToUrlAction(url=f'{base_url}/download-page', new_tab=False)), browser_session)assert result.error is None, f'Navigation to download page failed: {result.error}'@@ -228,7 +228,7 @@ class TestDownloadUploadFullCircle:for i, tab in enumerate(tabs_before):print(f' Tab {i}: {tab.url}')result = await tools.act(- GoToUrlActionModel(go_to_url=GoToUrlAction(url=f'{base_url}/upload-page', new_tab=True)), browser_session+ GoToUrlActionModel(navigate=GoToUrlAction(url=f'{base_url}/upload-page', new_tab=True)), browser_session)assert result.error is None, f'Navigation to upload page failed: {result.error}'print(f'✅ Navigation result: {result.extracted_content}')diff --git a/tests/ci/test_tools.py b/tests/ci/test_tools.pyindex e8625a0cf..2a86fac6c 100644--- a/tests/ci/test_tools.py+++ b/tests/ci/test_tools.py@@ -96,7 +96,7 @@ class TestToolsIntegration:"""Test that the registry contains the expected default actions."""# Check that common actions are registeredcommon_actions = [- 'go_to_url',+ 'navigate','search','click','input_text',@@ -125,10 +125,10 @@ class TestToolsIntegration:return ActionResult(extracted_content=f'Custom action executed with: {params.text} on {current_url}')# Navigate to a page first- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -209,10 +209,10 @@ class TestToolsIntegration:async def test_go_back_action(self, tools, browser_session, base_url):"""Test that go_back action navigates to the previous page."""# Navigate to first page- goto_action1 = {'go_to_url': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}+ goto_action1 = {'navigate': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action1), browser_session)@@ -221,7 +221,7 @@ class TestToolsIntegration:print(f'First page URL: {first_url}')# Navigate to second page- goto_action2 = {'go_to_url': GoToUrlAction(url=f'{base_url}/page2', new_tab=False)}+ goto_action2 = {'navigate': GoToUrlAction(url=f'{base_url}/page2', new_tab=False)}await tools.act(GoToUrlActionModel(**goto_action2), browser_session)# Verify we're on the second page@@ -259,10 +259,10 @@ class TestToolsIntegration:# Navigate to each page in sequencefor url in urls:- action_data = {'go_to_url': GoToUrlAction(url=url, new_tab=False)}+ action_data = {'navigate': GoToUrlAction(url=url, new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**action_data), browser_session)@@ -293,7 +293,7 @@ class TestToolsIntegration:assert 'scroll' not in excluded_tools.registry.registry.actions# But other actions are still there- assert 'go_to_url' in excluded_tools.registry.registry.actions+ assert 'navigate' in excluded_tools.registry.registry.actionsassert 'click' in excluded_tools.registry.registry.actionsasync def test_search_action(self, tools, browser_session, base_url):@@ -325,10 +325,10 @@ class TestToolsIntegration:file_system = FileSystem(temp_dir)# First navigate to a page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/page1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -392,10 +392,10 @@ class TestToolsIntegration:)# Navigate to the dropdown test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/dropdown1', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/dropdown1', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)@@ -519,10 +519,10 @@ class TestToolsIntegration:)# Navigate to the dropdown test page- goto_action = {'go_to_url': GoToUrlAction(url=f'{base_url}/dropdown2', new_tab=False)}+ goto_action = {'navigate': GoToUrlAction(url=f'{base_url}/dropdown2', new_tab=False)}class GoToUrlActionModel(ActionModel):- go_to_url: GoToUrlAction | None = None+ navigate: GoToUrlAction | None = Noneawait tools.act(GoToUrlActionModel(**goto_action), browser_session)diff --git a/tests/ci/test_url_shortening.py b/tests/ci/test_url_shortening.pyindex 6ea45b15d..022e6de23 100644--- a/tests/ci/test_url_shortening.py+++ b/tests/ci/test_url_shortening.py@@ -93,7 +93,7 @@ class TestUrlShorteningOutputProcessing:'evaluation_previous_goal': 'Successfully processed the request','memory': f'Found useful info at {shortened_url}','next_goal': 'Complete the documentation review',- 'action': [{'go_to_url': {'url': shortened_url, 'new_tab': False}}],+ 'action': [{'navigate': {'url': shortened_url, 'new_tab': False}}],}# Create properly typed AgentOutput with custom actions@@ -109,7 +109,7 @@ class TestUrlShorteningOutputProcessing:assert SUPER_LONG_URL in (agent_output.thinking or '')assert SUPER_LONG_URL in (agent_output.memory or '')action_data = agent_output.action[0].model_dump()- assert action_data['go_to_url']['url'] == SUPER_LONG_URL+ assert action_data['navigate']['url'] == SUPER_LONG_URLclass TestUrlShorteningEndToEnd:@@ -137,7 +137,7 @@ class TestUrlShorteningEndToEnd:'evaluation_previous_goal': 'Starting documentation extraction','memory': f'Target URL: {shortened_url}','next_goal': 'Extract API documentation',- 'action': [{'go_to_url': {'url': shortened_url, 'new_tab': True}}],+ 'action': [{'navigate': {'url': shortened_url, 'new_tab': True}}],}# Create AgentOutput with custom actions@@ -153,8 +153,8 @@ class TestUrlShorteningEndToEnd:assert SUPER_LONG_URL in (agent_output.thinking or '')assert SUPER_LONG_URL in (agent_output.memory or '')action_data = agent_output.action[0].model_dump()- assert action_data['go_to_url']['url'] == SUPER_LONG_URL- assert action_data['go_to_url']['new_tab'] is True+ assert action_data['navigate']['url'] == SUPER_LONG_URL+ assert action_data['navigate']['new_tab'] is True# Verify original shortened content is no longer presentassert shortened_url not in (agent_output.thinking or '')diff --git a/tests/scripts/debug_iframe_scrolling.py b/tests/scripts/debug_iframe_scrolling.pyindex 7b02fba66..62682bed3 100644--- a/tests/scripts/debug_iframe_scrolling.py+++ b/tests/scripts/debug_iframe_scrolling.py@@ -38,7 +38,7 @@ async def debug_iframe_scrolling():"next_goal": "Navigate to the iframe test page","action": [{- "go_to_url": {+ "navigate": {"url": "https://browser-use.github.io/stress-tests/challenges/iframe-inception-level1.html","new_tab": false}