1. Overview #
Clicknium web automation offers support for various popular web browsers such as Chrome, Microsoft Edge, IE, Firefox, Brave, and Vivaldi. To begin recording, you need to install an extension for either Chrome, Edge, Firefox, Brave or Vivaldi .
During recording, When you record a web browser pages, Clicknium will auto detect and choose appropriate web automation to record the element. For Chrome and Edge, Clicknium supports CDP, so that you can use CDP API to run the Python project without browser extension. Browser extension is still required for recording.
2. Locator attributes #
In order to better understand web automation, it’s recommended to start by grasping the concept of locator. Here are the attributes defined for web automation:
(1). Tab #
Name | equals | contains | startWith | endWith | regex |
---|---|---|---|---|---|
Name | Yes | Yes | Yes | Yes | Yes |
Title | Yes | Yes | Yes | Yes | Yes |
URL | Yes | Yes | Yes | Yes | Yes |
ClassName | Yes | Yes | Yes | Yes | Yes |
Role | Yes | No | No | No | No |
Index | Yes | No | No | No | No |
(2). Web #
Name | equals | contains | startWith | endWith | regex |
---|---|---|---|---|---|
Name | Yes | Yes | Yes | Yes | Yes |
Id | Yes | Yes | Yes | Yes | Yes |
Type | Yes | Yes | Yes | Yes | Yes |
AncestorId | Yes | Yes | Yes | Yes | Yes |
AncestorName | Yes | Yes | Yes | Yes | Yes |
CssSelector | Yes | Yes | Yes | Yes | Yes |
Class | Yes | Yes | Yes | Yes | Yes |
AncestorClass | Yes | Yes | Yes | Yes | Yes |
SInfo | Yes | Yes | Yes | Yes | Yes |
TabIndex | Yes | Yes | Yes | Yes | Yes |
Href | Yes | Yes | Yes | Yes | Yes |
Src | Yes | Yes | Yes | Yes | Yes |
Title | Yes | Yes | Yes | Yes | Yes |
XPath | Yes | No | No | No | No |
Tag | Yes | No | No | No | No |
TableRow | Yes | No | No | No | No |
TableCol | Yes | No | No | No | No |
IsLeaf | Yes | No | No | No | No |
Index | Yes | No | No | No | No |
3. Locator samples #
- Azure devops ‘A’ element
<Application processName="chrome" filePath="chrome.exe" version="1.3" />
<Tab className="Chrome_WidgetWin_1" role="window" title="sprint query - Boards" />
<Web ancestorId="row_vss_4_4" tag="A" />
- Bing search input
<Application processName="msedge" filePath="msedge.exe" version="1.3" />
<Tab className="Chrome_WidgetWin_1" role="window" url="https://*bing.com/" />
<Web id="sb_form_q" name="q" tag="INPUT" />
- Bing search icon
<Application processName="msedge" filePath="msedge.exe" version="1.3" />
<Tab className="Chrome_WidgetWin_1" role="window" url="https://*bing.com/" />
<Web ancestorId="search_icon" tag="svg" />
- Bing search result item
<Application processName="msedge" filePath="msedge.exe" version="1.3" />
<Tab className="Chrome_WidgetWin_1" role="window" url="https://*bing.com/search?*" />
<Web ancestorId="b_results" cssSelector="body>div>main>ol>li h2>a" tag="A" />
4. Web element properties #
By using find_element with a web locator, you can obtain a web element and then retrieve its properties through get_property. Clicknium web elements support the following properties:
Name | Description |
---|---|
pagetitle | the title of the current HTML page |
readystate | the loading state of the document, return 1 if Document.readyState equals “complete” or return 0 |
ID | the unique ID for an HTML element |
URL | URL of current page |
htmlwindowname | window.name in javascript |
title | the title of an element |
cookie | the cookies value, format is cookiename=value, multiple cookies split by ; |
innertext | the inner text of an element |
innertextshort | at most 512 char of innertext |
outertext | the outer text of an element |
outertextshort | at most 512 char of outertext |
innerhtml | the HTML content (inner HTML) of an element |
innerhtmlshort | at most 512 char of innerhtml |
outerhtml | the HTML elements, including attributes, start tag, and end tag |
outerhtmlshort | at most 512 char of outerhtml |
tag | the tag name of an element |
ancestorid | a Clicknium custom property, the ID of first ancestor node with ID attribute in the DOM tree |
ancestorname | a Clicknium custom property, the name of the first ancestor node with Name attribute in the DOM tree |
ancestorcss | a Clicknium custom property, the class of the first ancestor node with Class attribute in the DOM tree |
tablerow | if the element is in one table, return the row of the element |
tablecol | if the element is in one table, return the column of the element |
rowname | row header name |
colname | column header name |
columncount | column count |
rowcount | row count |
ischecked | whether the element(checkbox, radio) is checked |
sinfo | a clicknium custom property, the text displayed |
sinfoshort | at most 512 char of sinfo |
css_selector | css selector |
class | value of the HTML class attribute |
selecteditem | the text of selected option |
selecteditems | the text of all options |
isleaf | a clicknium custom property, whether the node is leaf in DOM |
tabindex | the value of the tabindex attribute of an element |
href | value of element’s href attribute |
XPath | xpath value |
Type | value of element’s type attribute |
Src | value of element’s src attribute |
Role | value of element’s role attribute |
Name | value of element’s name attribute |