Find Internet Explorer Browser
Verb: findBrowser
Finds Internet Explorer's browser windows that have not been launched through IBM Robotic Process Automation Studio.
Syntax
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
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--usetable | usetable(Obsolete) | Optional | Boolean | |
--forcerefresh | Update Screen Cache | Optional | Boolean | When enabled, it reads the screen again before executing the command to identify new elements and update the screen cache.
This identification is necessary for the command to work, in case there is any change on the screen. |
--selector | Selector | Required | ControlSelectors | Type of selector to be used to identify the interface controls in the browser, which are:
It is possible to use the IBM Robotic Process Automation Studio “Recorder” to map the controls and to obtain the necessary “Selector” parameter information, in addition to automatically inserting this parameter's data in the script. The “Recorder” is available in the upper toolbar of the platform. |
--id | Id | Only whenSelector is Id, IdAndName | Text | Browser interface control ID. |
--name | Name | Only whenSelector is Name, NameAndValue, IdAndName, TypeAndName | Text | Name of the interface control in the browser. |
--innertext | Inner Text | Only whenSelector is InnerTextAndTag | Text | Internal text of the interface control element in the browser. |
--tagname | Element Type | Only whenSelector is InnerTextAndTag | Text | Type of the interface control element in the browser.
And element can be a button, a text box, among others. |
--xpath | XPath | Only whenSelector is XPath | Text | XML path of the interface control in the browser. |
--classname | Class | Only whenSelector is ClassAndValue, ClassName | Text | Class name of the interface control in the browser. |
--elementvalue | Element Value | Only whenSelector is ClassAndValue, NameAndValue | Text | Current value of the interface control in the browser. |
--controltype | Type | Only whenSelector is TypeAndIndex, TypeAndName | ControlTypes | Type of control application in the browser. |
--index | Index | Only whenSelector is TypeAndIndex | Number | Current index of the interface control in the browser. |
--control | control_label | Only whenSelector is Instance | Control | Control instance.
This variable is obtained using the command Search Control. |
--timeout | Timeout | Optional | Time Span, Number, Text | Maximum wait time for command execution.
In case no value is defined for the timeout parameter, the execution uses the context timeout defined by the Set Timeout command. If that command is not used on the script, the default timeout is 5 seconds. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
success | Success | Boolean | Returns "True", if the window is found, or "False", otherwise. |
value | Browser | Browser | Returns the Internet Explorer browser variable to be manipulated. |
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 command, and the "XPath" selector from the Find Internet Explorer Browser command, to attach this browser with IBM Robotic Process Automation Studio and navigate to the IBM Robotic Process Automation's web site.
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
// Search and associate the Internet Explorer window using the "IEFrame" class.
findWindow --classname IEFrame window=value processId=processId foundWindow=success
attachWindow --window ${window}
// Find the Internet Explorer browser instance, and navigate to the IBM Robotic Process Automation web site.
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}"
For the script to work correctly, Internet Explorer must have been previously started.