UiPath

How to open and close IE and Chrome browser in UiPath.

In UiPath Studio development, we often manipulate the browser.

However, for browsers other than IE (Chrome, FireFox, Edge), you need to install an extension. Also, some people do not know how to open and close the browser.

This article explains the basic operations of the browser in IE, Chrome, FireFox, and Edge, as well as the basic operations of opening and closing the browser.

This site was created by translating a blog created in Japanese into English using the DeepL translation.

Please forgive me if some of the English text is a little strange

 

Open a browser

Open your browser in IE (Internet Explorer )

To open the browser in IE (Internet Explorer), use the “Open Browser” activity.

“Open Browser” is located in [UI Automation > Browser].

 

Open Browser  Setting item

Setting location Setting item Setting contens
Body
URL field The URL field allows you to provide the link to which the browser opens.
Properties Common ContinueOnError Specifies if the automation should continue even when the activity throws an error.
DisplayName The display name of the activity.
Input BrowserType Choose the type of browser you want to use by using the dropdown button.
Url The URL that you want to open in the specified browser.
Misc Private  If selected, the values of variables and arguments are no longer logged at Verbose level.
Options
CommunicationMethod Choose the communication method.
Hidden Open a hidden browser.
NewSession Starts a new session of the selected browser.
Private Open a private/incognito session.
UserDataFolderMode The UserDataFolderMode you want to set.
UserDataFolderPath The user data folder that the browser will use.

 

Sample Process
Open the URL “https://www.yahoo.com” in IE.

・Open Browser  Properties

・Execution result

sea otter-kun
sea otter-kun
If you run the sample process, it will open the Yahoo page in IE.

 

Open the browser in Chrome, FireFox, or Edge.

To open the browser in Chrome, FireFox, or Edge, use the “Open Browser” activity.

“Open Browser” is located in [UI Automation > Browser].

We will also explain how to install the extensions necessary to operate the UI of the opened browser.

 

Open Browser  Setting item

Setting location Setting item Setting contens
Body
URL field The URL field allows you to provide the link to which the browser opens.
Properties Common ContinueOnError Specifies if the automation should continue even when the activity throws an error.
DisplayName The display name of the activity.
Input BrowserType Choose the type of browser you want to use by using the dropdown button.
Url The URL that you want to open in the specified browser.
Misc Private  If selected, the values of variables and arguments are no longer logged at Verbose level.
Options
CommunicationMethod Choose the communication method.
Hidden Open a hidden browser.
NewSession Starts a new session of the selected browser.
Private Open a private/incognito session.
UserDataFolderMode The UserDataFolderMode you want to set.
UserDataFolderPath The user data folder that the browser will use.

 

 

How to install the extension
(1) Start Studio and click [Tools].

(2) Click on the target browser. (In this case, select Chrome).

(3) [OK]をクリックする。

(4) [OK]をクリックする。

(5) [OK]をクリックする。

 

(6) Open Crhome and click [Enable Extensions].

This completes the installation of the extension.

penguin-san
penguin-san
If you do not install the extension, you will not be able to perform UI operations such as clicking and typing.

 

Sample Process
Open the URL “https://www.yahoo.com/” in Crhome.

・Open Browser  Properties

penguin-san
penguin-san
Under Browser Type, select [Browser Type Chrome].

 

・Execution result

sea otter-kun
sea otter-kun
If you run the sample process, it will open a Yahoo page in Chrome.

 

Operate the opened browser again

Using the browser object to manipulate the browser again

  1. Open a browser
  2. Control other apps
  3. Operate the browser again.

If you want to manipulate the opened browser again, it is recommended to use the browser object (Browser type) in “Attach Browser”.

sea otter-kun
sea otter-kun
You can attach it without using a selector, so it’s more stable.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE
->Open Notepad
->Specify the browser you first opened with the browser object and write [abcde] in the search window

 

・Open Browser Properties

penguin-san
penguin-san
Sets a variable of the browser object (Browser type) to the UI browser.

 

・Open Application  Properties

 

・Attach Browser  Properties

sea otter-kun
sea otter-kun
Specify the browser object that was just output as the browser.

 

・Type Into  Properties

 

・変数

ペンギンさん
ペンギンさん
Browser type is selected from “Uipath.Core.Browser”.

 

・Execution result

sea otter-kun
sea otter-kun
When you run the sample process, [abcde] will be entered in the search window of your browser.

 

 

Use the selector to control the browser again.

  1. Open a browser
  2. Control other apps
  3. Operate the browser again.

If you want to manipulate the opened browser again, you can use the “Attach Browser” selector.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE
->Open Notepad
->Use the selector to specify the first browser you opened and write [abcde] in the search window.

・Open Browser  Properties

・Open Application  Properties

・Attach Browser  Properties

・Type Into  Properties

penguin-san
penguin-san
This time, it is specified by a selector. It is more unstable than the browser object because it will cause an error if the selector changes.

 

・Execution result

 

Scrolling through the browser

Use the “Send Hotkey” activity to scroll the browser.

“Send Hotkey” is located in UI Automation>Element>Keyboard.

 

Send Hotkey  Setting item

Setting location Setting item Setting contents
Body
KeyModifiers Enables you to add a key modifier.
Key The key or key combination that compose the hotkey that is sent.
Properties Options KeyModifiers Enables you to add a key modifier.
SpecialKey Indicates if you are using a special key in the keyboard shortcut.
SendWindowMessages If this check box is selected, the hotkey is executed by sending a specific message to the target application.
DelayBetweenKeys Delay time (in milliseconds) between two keystrokes.
ClickBeforeTyping When this check box is selected, the specified UI element is clicked before the text is written.
EmptyField When this check box is selected, all previously-existing content in the UI element is erased before writing your text.
Activate When this check box is selected, the specified UI element is brought to the foreground and activated before the text is written.
Input Key The key or key combination that compose the hotkey that is sent.
Common DisplayName The display name of the activity.
DelayMS Delay time (in milliseconds) after executing the activity.
DelayBefore Delay time (in milliseconds) before the activity begins performing any operations.
ContinueOnError Specifies if the automation should continue even when the activity throws an error.
Misc Private  If selected, the values of variables and arguments are no longer logged at Verbose level.
Target.Selector Text property used to find a particular UI element when the activity is executed.
Target.TimeoutMS Specifies the amount of time (in milliseconds) to wait for the activity to run before the SelectorNotFoundException error is thrown.
Target.WaitForReady  Before performing the actions, wait for the target to become ready.
Target.Element Use the UiElement variable returned by another activity.
Target.ClippingRegion Defines the clipping rectangle, in pixels, relative to the UiElement, in the following directions: left, top, right, bottom.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE.
->Scroll down
->Scroll up

 

・Open Browser  Properties

 

・Send Hotkey downkey  Properties

 

・Send Hotkey Space (scroll down)  Properties

sea otter-kun
sea otter-kun
Space is represented by the key ” ” and the special key False.

 

・Send Hotkey upkey  Properties

・Send Hotkey Shift+Space (scroll up)

・Execution result

penguin-san
penguin-san
Your browser will scroll down, then up.

 

Change the size of the window

Maximize the window

To maximize the browser window, use the “Maximize Window” activity.

“Maximize Window” can be found in [UI Automation > Maximize] Window.

 

Maximize Window  Setting item

Setting location Setting item Setting contents
Properties Input Window The window that you want to maximize.
Common DisplayName The display name of the activity.
ContinueOnError Specifies if the automation should continue even when the activity throws an error.
Misc Private If selected, the values of variables and arguments are no longer logged at Verbose level.

 

Sample Process
Open the URL of “https://www.yahoo.com/” in IE
->Maximize the window

・Open Browser  Properties

・Maximize Window  Properties

・Execution result

penguin-san
penguin-san
When the sample process is executed, the browser window will be maximized.

 

Minimize the window

To minimize the browser window, use the “Maximize Window” activity.

“Maximize Window” is located in [UI Automation > Windows].

 

Maximize Window  Setting item

Setting location Setting item Setting contents
Properties Input Window The window that you want to minimize. Only supports Window variables.
Common DisplayName The display name of the activity.
ContinueOnError Specifies if the automation should continue even when the activity throws an error.
Misc プライベート If selected, the values of variables and arguments are no longer logged at Verbose level.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE.
->Minimize the window

・Open Browser  Properties

・Minimize Window  Properties

・Execution result

sea otter-kun
sea otter-kun
The result of running the sample process shows that the browser is minimized.

 

Go to the specified URL.

To navigate to the specified URL, use the “Navigate To” activity.

“Navigate To” is found in [UI Automation> Browser].

 

Navigate To  Setting item

Setting location Setting item Setting Contents
Properties Input URL The location of the web page to display
Browser The browser in which you want to navigate to the specified page.
Common DisplayName The display name of the activity.
ContinueOnError Specifies if the automation should continue even when the activity throws an error.
Misc Private  If selected, the values of variables and arguments are no longer logged at Verbose level.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE.
->Go to “https://www.msn.com/en-us”.

・Oepn Browser  Properties

 

・Navigate To  Properties

 

・Execution result

rakko-kun
rakko-kun
After opening the yahoo page, go to the msn page.

 

Refresh your browser

To refresh the browser, use the “Refresh Browser” activity.

“Refresh Browser” is located in [UI Automation > Browser].

 

Refresh Browser  Setting item

Setting location Setting item Setting Contents
Properties Input Browser The browser that you want to reload. Only Browser variables are supported.
Common DisplayName The display name of the activity.
ContinueOnError Specifies if the automation should continue even when the activity throws an error.
Misc Private If selected, the values of variables and arguments are no longer logged at Verbose level.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE.
->Refresh your browser

・Open Browser  Properties

 

・Refresh Browser  Properties

 

・Execution result

penguin-san
penguin-san
When you run the sample process, it will open the browser and then refresh it.

 

Close tabs and browsers

Close tabs

To close a browser tab, use the “Close Tab” activity.

“Close Tab” is located in [UI Automation > Browser].

 

Close Tab  Setting item

Setting location Setting item Setting Contents
Properties Input Browser The browser page that you want to close.
Common DisplayName  The display name of the activity.
ContinueOnError Specifies if the automation should continue even when the activity throws an error.
Misc Private If selected, the values of variables and arguments are no longer logged at Verbose level.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE.
->Open tabs with shortcut keys
->Close tabs

・Open Browser  Properties

 

・Send Hotkey Shortcut keys for opening tabs  Properties

・Close Tab  Properties

・Execution result

sea otter-kun
sea otter-kun
When you run the sample process, it will open a tab and then close one tab.

 

Close the browser

To close the browser, use the “Close Window” activity.

“Close Window” is located in UI Automation > Windows.

 

Close Window  Setting item

Setting location Setting item Setting Contents
Properties Input UseWindow The window that you want to close.
TimeoutMS  Specifies the amount of time (in milliseconds) to wait for the activity to run before an error is thrown.
Selector Text property used to find a particular UI element when the activity is executed.
WaitForReady Before performing the actions, wait for the target to become ready.
Common DisplayName The display name of the activity.
ContinueOnError Specifies if the automation should continue even when the activity throws an error.
Misc Private If selected, the values of variables and arguments are no longer logged at Verbose level.

 

Sample Process
Open the URL “https://www.yahoo.com/” in IE.
->Close the browser

・Open Browser  Properties

・Close Window  Properties

・実行結果

penguin-san
penguin-san
When you run the sample process, it opens and closes the browser, so nothing is open on the desktop.

 

 

Summary

  • To open the browser, use the “Open Browser” activity.
  • To perform UI operations after opening the file in Chrome, FireFox, or Edge, you need to install an extension.
  • To close the browser, use the “Close Window” activity.