Handling of Tabs
msg.ZenTestAI supports the handling of multiple browser tabs and windows. By default, msg.ZenTestAI will follow new tabs automatically. This means that if a new tab is opened during the execution of a test case, msg.ZenTestAI will switch to the new tab.
Example of Steps:
- Click link labeled "Open new tab"
- Expect a car to be visible. this refers to the new tab
It is possible to switch, close, create, and make expectations on specific tabs using prompting in steps.
Switching Between Tabs
You can switch to a specific browser tab by referencing the tab number or its title.
Examples:
- "Switch to tab 2"
- "Switch to the tab with the title 'msg systems'"
- "Switch to browser tab 3"
Closing Tabs
You can close specific browser tabs or the currently active tab.
Examples:
- "Close tab 2"
- "Close the tab with the title 'Settings'"
- "Close the current tab"
- "Close this tab"
You cannot close the last remaining tab. At least one tab must remain open during test execution.
Creating New Tabs
You can create new browser tabs, either empty or with a specific URL.
Examples:
- "Open a new tab"
- "Create a new browser tab"
- "Open https://www.msg-systems.com in a new tab"
- "Create a new tab and navigate to https://www.zentest.ai"
When creating a new tab with a URL, you can specify the URL with or without the protocol (https://). If no protocol is specified, https:// will be added automatically.
Tab Expectations
You can make expectations about the number, title, and URL of tabs.
Examples:
- "Expect that there are two tabs open"
- "Expect that there are two tabs open with URL 'https://www.msg-systems.com' and 'https://www.zentest.ai'"
- "Expect that tab 2 has the title 'msg systems'"
msg.ZenTestAI can prompt on the number, the title and the URL of the tabs.
"When switching tabs please remember that "select tab" is very similar to selecting a tab inside a tab within a set of tabs in the displayed browser content. This can easily be confused by the AI agent. If you want to be sure to talk about browser tabs, use the term "browser tab", e.g. "switch to browser tab 2".
Handling of Browser Prompts
msg.ZenTestAI currently does not allow handling of browser-prompts but will automatically close them. This is to ensure that the test case is not blocked by a modal browser prompt. Examples for browser prompts are browser managed popups for e.g. confirmations and alerts. In case of more than 6 prompts (not configurable) inside a session the test case will be marked as failed and the test execution will stop.
Future versions of msg.ZenTestAI will include the handling of browser prompts. See the Planned Features for more information.