Pre-General Availability: 2024-09-02

Use Case: Switch Browsers

A robot must resume working in an already-open internet browser after starting to work in a second internet browser. Explore how the open browser and switch browser actions support this workflow.

Scenario

A robot completes the following tasks:

  1. Opens an internet browser.

  2. Completes a task.

  3. Opens another internet browser.

  4. Completes a task.

  5. Resume working in the first internet browser

Workflow

Requirement How to meet the requirement

Add two open browser actions to the robot, as well as any additional actions

Build the robot as required, as shown in the following example.

A robot contains 6 actions: open browser, get text, log, open browser, get text, and log.

Use a variable to define the output for each open browser action

For example, create two variables, index1 and index2, to store the index value for each open browser action.

The index is an assigned number. The index for the first open browser action in the robot is 1, the index for the second browser action in the robot is 2, and so on.

For the first open browser action, the output is set to the index1 variable.

For the first open browser action, the output is set to the index2 variable.

When the robot needs to switch back to the first internet browser, add a switch browser action to the robot

Define the Browser window field using the index1 variable. Alternatively, you can hard-code a value of 1, as long as you're switching back to the first browser window that you opened.

For a switch browser action, the Browser window field is set to the index1 variable