Check for a tab Version 1 (Java)
Action group: Browsers
Description
The action checks for the presence of the specified tab 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 |
Tab name | The name of the open browser tab. If the "Tab index" field is also filled in, the search priority will be by tab name. | Robin.Numeric | No | |
Tab index | The serial number of the opened browser tab. The numbering starts from 0. If the “Tab name” field is also filled in, the search priority will be by tab name. | Robin.String | No | |
Results | ||||
Result | If the value is "true", then the desired tab is open in the browser. If "false", then the browser does not have the desired tab. | Robin.String |
Special conditions of use
The numbering of tabs is done in the order of opening and does not depend on the subsequent movement of tabs in the browser, but always corresponds to their current number. I.e. after removing the 4th tab from 5, the 5th tab will become the 4th.
Text comparison when selecting a tab is case-insensitive.
Tab search priority: if both search options are specified, it searches by name only. “Tab index” will be ignored.
Even if the tab is in a group, the action will also check for the tab.
If the tabs are put in a group and the group is asked to open in a new window, the tabs in the new window will still be counted because they have the same context. And if you try to close the context (browser), all the windows generated from it will be closed.
The action before launching remembers which tab was opened initially and returns to it after checking the other tabs by name. If you close the memorized tab while the action is running, the action will fail.
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.