Skip to main content

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:

  1. Click link labeled "Open new tab"
  2. 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"
warning

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:

tip

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:

msg.ZenTestAI can prompt on the number, the title and the URL of the tabs.

tip

"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.

tip

Future versions of msg.ZenTestAI will include the handling of browser prompts. See the Planned Features for more information.