Get the number of tabs Version 1 (Java)
Action group: Browsers
Description
The action returns the number of tabs in the browser.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Context | Action context for browser operations. | Robin.Selenium | Browser context | Yes |
Results | ||||
Result | The number of tabs in the browser. | Robin.Numeric |
Special conditions of use
The action will not fail if there are no open tabs in the browser other than the browser home page.
Tab groups will be counted by the number of tabs inside. A group does not count as one tab.
If you put tabs in a group and ask the group to open in a new window, the tabs in the new window will still be counted because the context remains shared. And if you try to close the context (browser), all windows generated from it will be closed.
Example of use
Task
Open two tabs in a browser, switch to the first one and refresh it.
Solution
Use the "Open Browser", "Navigate", "Switch to Tab", "Refresh" actions.
Implementation
- Assemble a robot scheme with the actions.
- Set the "Open browser" action parameter.
- Set the "Navigate" action parameters (the first link).
- Set the "Navigate" action parameters (the second link).
- Set the "Switch to Tab" action parameters.
- Set the "Refresh" action parameter.
- Click "Start" in the top panel.
Result
The program robot completed successfully.
Обзор
Инструменты контента