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

image-2024-12-24_11-53-20.png

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for browser operations.Robin.SeleniumBrowser contextYes
Tab nameThe 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
ResultIf 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

  1. Assemble a robot scheme with the actions.
  2. Set the "Open browser" action parameter.
  3. Set the "Navigate" action parameters (the first link).
     
  4. Set the "Navigate" action parameters (the second link).
     
  5. Set the "Switch to Tab" action parameters.
  6. Set the "Refresh" action parameter.
  7. Click "Start" in the top panel.

Result

The program robot completed successfully.

  • Нет меток