The Browser module empowers a robotic process to open and interact with web browsers. Through this module, you can navigate to a URL and interact with the web page just as a human would: click on the page controls, select options, enter values in text fields, retrieve HTML items, and more.
This page describes how to integrate browser methods into your robotic process. Appian RPA's low-code Browser module provides an easier and more robust development experience. For more experienced developers, this page also discusses the options available using the Java module.
To make robotic process development even faster, you can use Selenium IDE to record browser actions and import the file as a section in Appian RPA.
The Browser low-code module lets you configure how the robotic process opens and interacts with a web browser. The low-code module simplifies this step in robotic process development by bringing these methods to the Actions dialog and presenting the available options, rather than requiring you to code it using Java.
While these methods can be called using methods in the Java code, using the methods from the robotic process workflow is both easier and more robust. When you build the robotic process workflow, you'll see the following methods available in the Browser module:
A few of these methods, described below, are commonly used and contain multiple options to create a specific configuration.
This method lets you find the attribute value of one or more elements on the screen. This method contains the following configurations:
Attribute to return: Contains multiple options:
Display name | Returns | Description |
Value | Text | The value of the "value" attribute. Many types of components may contain a "value" attribute, though selection components may find other options more in line with what they're looking for (dropdowns use either Selected dropdown options or First selected dropdown option, while checkboxes and radio buttons may use Is selected?). |
Hypertext reference | Text | The value of the "href" attribute. |
Inner HTML text | Text | The text contained within an HTML tag. |
Image source | Text | The value of the "src" attribute of an image. |
Class name | Text | The value of the "className" attribute of an element. Many types of components have this attribute, but it will typically only be extracted from visual components such as icons. |
All dropdown options | List of Maps | Each Map represents WebElement and contains three entries: index , value , and text . If the dropdown does not contain any options, returns an empty list. |
Selected dropdown options | List of Maps | Each Map represents WebElement and contains three entries: index , value , and text . If no options are selected, returns an empty list. |
First selected dropdown option | Map | Returns a Map representing WebElement containing three entries: index , value , and text . If no option is selected, returns null . |
Is enabled? | Boolean | Returns true if the element is enabled or false if it is disabled. |
Is displayed? | Boolean | Returns true if the element is displayed or false if it exists but is not displayed. |
Is multiple? | Boolean | Returns true if the dropdown supports selecting multiple options or false if it does not. If this option is used on a component that is not a dropdown, it will return false . |
Is selected? | Boolean | Returns true if the checkbox or radio button option is selected or false if it is not. |
Other | Text | varies |
null
.This action will return a list. Each index in the list corresponds to the attribute value of one element. If the attribute for any element isn't found, the value at that index will be null
.
This browser method lets you interact with elements on the screen, based on the selection and configurations you specify. This method contains the following configurations:
This method lets you wait for one or more elements to have a specific attribute before the process continues. This method contains the following configurations:
If you have a use case that isn't covered by one or more of the low-code code actions, you can fall back to using the Java module. To use the Browser module in your projects, you first must include the module dependency in the pom.xml.
The Browser module requires Selenium to work properly and interact with browsers.
This section describes each of the components needed to work with the Appian RPA Browser module:
selenium-java
, are called drivers. It is important to know this terminology to avoid confusion.The following image shows how all these components are connected:
Different servers available for each supported browser:
Once downloaded, you must add the driver to the robotic process configuration as Support Files. Usually, a robotic process will only have to interact with one browser, so you don't need to upload all the files shown in the image.
Not all versions of each component are compatible with each other. We recommend that you always work with the most recent versions of the browsers and their bridge servers. In all cases, they must be compatible with the Selenium version integrated into the Appian RPA Browser module. Visit the links below for each web browser to know what versions are supported for the rest of the components:
The core interface of the Appian RPA Browser module is com.novayre.jidoka.browser.api.IWebBrowserSupport
. This interface provides the methods to interact with the browser and the components of a page.
This code snippet calls the interface:
1
2
IWebBrowserSupport browser =
IWebBrowserSupport.getInstance(this, client);
Where client is an instance of IClient and this is a reference to the robotic process that uses the module.
Once the instance of IWebBrowserSupport is called, we should properly initialize it. Set the browser to use and the default timeout:
1
2
3
// Set the browser to Chrome
browser.setBrowserType(EBrowsers.CHROME);
browser.setTimeoutSeconds(60);
In this example, Google Chrome is set as the browser with a timeout of 60
seconds.
The enumerator type EBrowsers contains the identifiers for all the supported browsers: CHROME
, INTERNET_EXPLORER
, and FIREFOX
.
To set other browsers:
1
2
3
4
5
// Set the browser to Internet Explorer
browser.setBrowserType(EBrowsers.INTERNET_EXPLORER);
// Set the browser to Mozilla Firefox
browser.setBrowserType(EBrowsers.FIREFOX);
Putting it all together, the full code to initialize the Browser module is:
1
2
3
4
5
6
7
8
9
10
// IClient
IClient client = IClient.getInstance(this);
// IWebBrowserSupport
IWebBrowserSupport browser =
IWebBrowserSupport.getInstance(this, client);
// Set the browser to Internet Explorer
browser.setBrowserType(EBrowsers.INTERNET_EXPLORER);
browser.setTimeoutSeconds(60);
Now that you have properly initialized the browser, you can open it and navigate to a web page. This example will open the browser and visit the Appian website:
1
2
3
4
5
6
// Open browser
browser.initBrowser();
// Navigate to a URL
String url = "http://www.appian.com";
browser.navigate(url);
Appian RPA relies on the Selenium WebDriver API to simulate user interaction in the browsers. Consult the Selenium documentation below for your browser and your browser version. Refer to the Browser module architecture for instructions on how to configure the robotic processes.
For further information, go to the Selenium website.
When a new tab is opened by the browser either automatically or as the result of a user action, you are required to explicitly switch to this tab if you want to interact with it.
To change from one tab to another in the Browser module, you must call the switchTo() method as described below:
Example:
1
2
3
List<String> tabs = new ArrayList<String>(browser.getDriver().getWindowHandles());
browser.getDriver().switchTo().window(tabs.get(tabs.size() - 1));
To access the elements contained in another frame or another pop-up window, you must be positioned inside it. Using the element inspector of the browser, get the name of the frame containing the element to find and use it in the method browser.frameSetNavigation(String frame).
Yes, the Browser module is developed from Selenium and the developer can use all the options that Selenium offers by getting the driver invoking browser.getDriver()
.
To run JavaScript, use the following code:
1
2
3
JavascriptExecutor jsExecutor = ((JavascriptExecutor) browser.getDriver());
jsExecutor.executeScript("YOUR CODE HERE");
The purpose of the method findElement is to wait for a page to be completely loaded and to find an element on this page. As such, this method uses the default timeout defined in the Browser module (60 seconds). This means that if the element is not present on the page, the method keeps looking for up to 60 seconds.
To find a WebElement that is not always present in the page, use one of the following options:
Use the existsElement() method, which has a shorter default timeout.
1
2
3
4
5
if (browser.existsElement(By.xpath("//xpath/expression"))) {
server.info("Doesn't exist the element");
} else {
// ...
}
Modify the timeout used by the findElement method:
browser.setTimeOutSecondsWaitElement(int second);
If you change this timeout for a specific action, it is recommended to restore it afterwards.
Learn how to use the browser module in a robotic process
Use these tutorials to learn more about the Browser module:
On This Page