Chromium connector methods
Summarize
Summary of Chromium connector methods
The Chromium connector methods enable automation and interaction with applications, screens, and elements within Google Chrome and Microsoft Edge browsers. These methods are organized into three levels: Application level, Screen level, and Element level methods. They allow ServiceNow customers to navigate web pages, interact with UI elements, capture screen details, and simulate user actions efficiently.
Show less
Application level methods
- Navigate: Launches a web page by URL with optional timeout and screen loading delay. It can match elements before loading screens.
- WaitForAnyScreen: Delays processing until specified screens load, optionally matching captured elements.
Screen level methods
- Close: Closes the captured screen window.
- Focus: Sets focus on the captured window and returns success status.
- GetFields: Retrieves values of selected fields or elements within the screen.
- GetInnerHtml, GetPageSource: Returns inner HTML or full page source of the captured screen.
- GetScreenShot: Captures and returns a screenshot of the configured screen.
- GetTitle, GetURL: Returns the title or URL of the captured web page.
- GetValueByXPath: Retrieves values from XML nodes based on XPath queries.
- IsCreated: Indicates if the screen is successfully rendered, optionally matching elements before rendering.
Element level methods
- Click: Performs a click operation on the element.
- Focus: Sets focus on the element, optionally scrolling it into view.
- GetInnerHTML, GetInnerText, GetOuterHTML, GetOuterText: Retrieves HTML content or text from the element.
- IsCreated: Returns whether the element has loaded successfully.
- SetPassword: Securely inputs passwords into password fields, with an option to use SendKeys if needed.
- SendKeys: Sends keyboard inputs or shortcut keys to elements, with options to clear existing values and set typing delay.
- GetInstanceCount: Counts the number of instances of the element available.
- SimulateMouseEvent: Simulates mouse events (click, dblclick, contextmenu, etc.) on elements, requiring predefined events in HTML.
- SimulateEvent: Simulates specific HTML events (load, unload, change, submit, focus, blur, etc.) on pages or elements by event name.
Practical Benefits
These methods enable automation of browser-based workflows, such as navigating web applications, capturing screen data, interacting with UI elements, securely entering passwords, and simulating user actions. This empowers ServiceNow customers to build robust robotic process automations (RPA) and integrations that interact seamlessly with Chromium-based web applications.
The Chromium connector methods do different tasks on the applications, screens, and the elements on the screens of the Google Chrome and the Microsoft Edge browsers.
Chromium connector method levels
Application level methods
Navigate
Launches the web page based on the URL specified.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Url | URL of the web page. | Data In | String | No default value | No |
| Timeout | Option to specify the time in seconds after which the operation times out. | Data In | Integer | No default value | No |
| Return | If True, the web page has launched. Else, if False, the web page hasn't launched. | Data Out | Boolean | Not applicable | Not applicable |
WaitForAnyScreen
Sets a delay before the specified screens load.
- Click the method settings icon (
).
- On the CHOOSE SCREENS window, select the required screen.
- Click OK.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? | Notes |
|---|---|---|---|---|---|---|
| MatchAllChildren | If True, before loading the screen, the method matches the captured elements from the web page. Else, if False, the method doesn't match any element. | Data In | Boolean | No default value | No | The elements can be found in the MATCH CHILDREN section of the Chromium Connector window. |
| Timeout | Specifies the time in seconds after which the operation times out. | Data In | Integer | No default value | No |
Screen level methods
Close
Closes the captured screen window.
Focus
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | If True, the focus was set on the captured window. Else, if False, the focus wasn't set on the captured window. | Data out | Boolean | No default value | Not applicable |
GetFields
Returns the values of the specified fields or elements. For example, it can return the text in a button.
- Click the method settings icon (
).
- In the CHOOSE FORM ELEMENTS window, select the required fields.
- Click OK.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Name of the field or element | Field or element for which the method returns the value. | Data out | String | No default value | Not applicable |
GetInnerHtml
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the inner HTML of the captured screen. | Data out | Object | Not applicable | Not applicable |
GetPageSource
| Parameter | Description | Data Port Type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the page source of the captured screen. | Data Out | String | Not applicable | Not applicable |
GetScreenShot
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the screenshot of the configured screen. | Data out | Bitmap | No default value | Not applicable |
GetTitle
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the title of the web page captured. | Data out | String | No default value | Not applicable |
GetURL
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the URL of the web page that was captured. | Data out | String | No default value | Not applicable |
GetValueByXPath
Returns the value within an XML node from the specified XML path.
To provide inputs to the fields see Configure port properties.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| XPath | XPath of the web page captured. | Data In | String | No default value | No |
| Return | Returns the value from the XML node. | Data out | String | Not applicable | Not applicable |
IsCreated
Returns the Boolean value based on whether the screen is rendered successfully on the web application.
To provide inputs to the fields see Configure port properties.
| Parameter | Description | Data Port type | Data type | Default type | Mandatory? | Notes |
|---|---|---|---|---|---|---|
| MatchAllChildren | If True, before the screen is rendered, the method attempts to match all captured elements. Else, if False, no match is done. | Data In | Boolean | No default value | No | You can find the captured elements in the MATCH CHILDREN section of the Chromium Connector window. |
| Return | If True, the screen is rendered successfully. Else, if False, the screen has failed to render successfully. | Data out | Boolean | Not applicable | Not applicable |
Element level methods
Click
Performs a click operation on the element.
Focus
Sets the focus on the element.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| scrollIntoView | If True, the method uses the scrollbar to navigate to the captured element on the web page. Else, if False, it doesn't scroll to the captured element. | Data In | Boolean | No default value | No |
| Return | If True, the method sets focus on the element. Else, if False, the method has failed to set focus on the element. | Data Out | Boolean | Not applicable | Not applicable |
GetInnerHTML
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the inner HTML of the captured element. | Data Out | String | No default type | Not applicable |
GetInnerText
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the inner text in the captured element. | Data Out | String | Not applicable | Not applicable |
GetOuterHTML
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the outer HTML of the captured element. | Data out | String | No default value | Not applicable |
GetOuterText
| Parameter | Description | Data Port Type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | Returns the text content of the captured element. | Data out | String | No default value | Not applicable |
IsCreated
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Return | If True, the captured element has loaded. Else, if False, the captured element has failed to load. | Data out | Boolean | No default value | Not applicable |
SetPassword
Automate entering password securely in the password field of a web-based application, for example securely enter password in the password field of a login form.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? | Notes |
|---|---|---|---|---|---|---|
| Password | Accepts the password as a secured string. | Data In | Secured string | None | Yes | Since it accepts the password as a secured string, it only shows the length of the string when you right-click on the parameter and then click Preview Data. |
| UseSendKeys | SendKeys is a method used to send keyboard inputs such as characters, numbers, and symbols to text boxes inside an application. | Data In | Boolean | False | Yes | Tip: If the SetPassword method fails to input the password in the password field, set the value to True and execute the method again. |
SendKeys
Passes shortcut keys to the captured element.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| Keys | Takes the shortcut keys. | Data In | String | No default value | No |
| ClearExistingValue | If True, the method clears any existing value in the field. Else, if False, it doesn't clear the existing value. | Data In | Boolean | No default value | No |
| TypeDelay | Sets the typing delay between each key. | Data In | Double | No default value | No |
GetInstanceCount
Returns a count of the number of instances where the element is available.
GetOuterHTML
Gets the outer HTML of the captured element.
SendKeys
- Inputs
- ClearExistingValue
SimulateMouseEvent
contextmenu event on an element, the element must
already have the contextmenu event defined in the HTML.| Parameter | Description | Data Port type | Data type | Default value | Mandatory? | Notes |
|---|---|---|---|---|---|---|
| MouseEvent | Mouse event that occurs on the captured web page element. At the time of the mouse event occurring on a web page element, that element must already have the mouse event defined in the HTML. | Data In | MouseEventType | click | Yes | The method supports these mouse events.
|
| MouseButton | Simulates the mouse button click on the captured web page element. | Data In | MouseButtonType | Left | Yes | The method supports these mouse button actions.
|
SimulateEvent
Simulates the HTML event that you specify on a Google Chrome page or an element on the page.
| Parameter | Description | Data Port type | Data type | Default value | Mandatory? |
|---|---|---|---|---|---|
| EventName | Name of the HTML event. The method supports the events provided and you must enter the name of the event exactly as specified. HTML events
|
Data In | String | None | Yes |