Close tab Version 12 (Java)

Action group: Browsers


Description

The action closes the selected tab.

Action icon

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ContextAction context for working with the browserRobin.SeleniumBrowser contextYes
Tab indexTab indexRobin.Numeric
No
Tab titleTab nameRobin.String
No
Match typeThe type of text to match with the title. Strict - the title is equal to the «Text» parameter. Not strict - the title contains the «Text» parameter. Regular Expression - The title matches the regular expression in the «Text» parameter.Robin.String
No

Special conditions of use

Comparison of text when a tab is selected is case-insensitive.

If there is only one tab - System closes the browser.

Example of use

Task

Open browser and follow the link https://bankrot.cdtrf.ru//public/i/miregister.aspx, next open the page https://dzen.ru/?clid=2337508-193&from=dist_bookmark&win=381&yredirect=true in a new tab. After that close the second tab, leaving only the first one open.

Solution

Use the "Open browser", "Navigate", "Navigate", "Close tab" actions.

Implementation

  1. Assemble a robot scheme with the actions.
  2. Set the "Open browser" action parameters.
  3. Set the "Navigate" action parameters (for the first tab). 

  4. Set the "Navigate" action parameters (for the second tab). 
  5. Set the "Close tab" action parameters. If the "Tab index" parameter is filled in, it has a priority over the "Tab title" parameter.
  6. Click "Start" in the top panel.

Result 

The program robot completed successfully. The second tab is closed.

  • Нет меток