Find Internet Explorer Browser

Finds Microsoft Internet Explorer browser instances.

Command availability: IBM RPA SaaS and IBM RPA on premises

Description

Finds a Microsoft Internet Explorer browser instance that has not been started by IBM RPA Studio, or embedded to another application.

Script syntax

IBM RPA's proprietary scripting language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

findBrowser [--forcerefresh(Boolean)] --selector(ControlSelectors) --id(String) --name(String) --innertext(String) --tagname(String) --xpath(String) --classname(String) --elementvalue(String) --controltype(Nullable<ControlTypes>) --index(Numeric) --control(Control) [--timeout(TimeSpan)] (Boolean)=success (Browser)=value (String)=name

Dependencies

  • Microsoft Internet Explorer wasn't started by the Start Browser (webStart) command.

Input parameter

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
Update Screen Cache forcerefresh Optional Boolean Enable to read the screen again before running the command, use it to identify new elements and update the screen cache. This identification is necessary for the command to work if there is any change on the screen.
Selector selector Required ControlSelectors Type of selector to identify the interface controls in the browser.

See the selector parameter options.
Id id Required when the Selector parameter is Id, IdAndName Text The control ID of the browser instance.
Name name Required when the Selector parameter is Name, NameAndValue, IdAndName, TypeAndName Text Name of the interface of the browser instance.
Inner Text innertext Required when the Selector parameter is InnerTextAndTag Text Internal text of the interface control element in the browser.
Element Type tagname Required when the Selector parameter is InnerTextAndTag Text Type of the interface control element in the browser.
XPath xpath Required when the Selector parameter is XPath Text XML path of the interface control in the browser.
Class classname Required when the Selector parameter is ClassAndValue, ClassName Text Class name of the interface control in the browser.
Element Value elementvalue Required when the Selector parameter is ClassAndValue, NameAndValue Text Current value of the interface control in the browser.
Type controltype Required when Selector parameter is , TypeAndName ControlTypes Type of control application in the browser.
Index index Required when Selector parameter is TypeAndIndexCurrent Number Index of the interface control in the browser.
Control control Required when Selector parameter is Instance Control Control instance obtained using the Search Control (searchControl) command.
Timeout timeout Optional Text, Time Span, Number Maximum waiting time for running the command. When blank, the default timeout is 5 seconds.

selector parameter options

The following table displays the options available for the selector input parameter. The table shows the options available when working in Script mode and the equivalent label in the Designer mode.

Designer mode label Script mode name Description
Id Id Matches the element based on the ID attribute value.
Name Name Matches the element based on the Name attribute value.
Link text LinkText Matches the element based on the link text attribute value.
Inner text and control type InnerTextAndTag Matches the element based on the element text content and the tag name attribute value.
XPath XPath Matches the element based on the XML path in the HTML root.
Class and value ClassAndValue Matches the element based on the class name and value attribute.
Name and value NameAndValue Matches the element based on the name and the value attribute.
Id and name IdAndName Matches the element based on the id and name attribute value.
Class name ClassName Class name of the interface control in the browser.
Type and index TypeAndIndex Type of control and index of the browser interface.
Type and name TypeAndName Type of control and name attributed to the browser.
Intance Instance Control instance

Output parameter

Designer mode label Script mode name Accepted variable types Description
Success success Boolean Returns true, if the window was found, or false, otherwise.
Browser value Browser Returns the Internet Explorer browser instance. Use the Browser variable to manipulate the browser.
Name name Text Returns the name that was given to the browser.

Example

The Internet Explorer browser is searched, using the "Class" selector from the Find Window (findWindow) command, and the "XPath" selector from the Find Internet Explorer Browser (findBrowser) command, to attach this browser to IBM RPA Studio and navigate to the IBM web page.

defVar --name window --type Window
defVar --name processId --type Numeric
defVar --name foundWindow --type Boolean
defVar --name foundBrowser --type Boolean
defVar --name browser --type Browser
defVar --name browserName --type String
openFile --file "iexplore.exe"
// Search and associate the Internet Explorer window using the "IEFrame" class.
delay --timeout "00:00:03"
findWindow --classname IEFrame --safesearch  window=value processId=processId foundWindow=success
attachWindow --window ${window}
// Find the Internet Explorer browser instance, and navigate to the Google web page.
findBrowser --selector "XPath" --xpath "/root" --timeout "00:00:10" foundBrowser=success browser=value browserName=name
webNavigate --url "https://www.ibm.com/"
logMessage --message "Success in finding the browser: ${foundBrowser}\r\nFound browser name: ${browserName}" --type "Info"
webClose --name "${browserName}" --leavebrowseropen
Note:Microsoft Internet Explorer is deprecated, so the computer might open Microsoft Edge, close Microsoft Edge, and wait for the script to run.