Working with Web Elements
Most Browser activities (such as Click, Type Into, and Hover) interact with web elements on a webpage. This guide explains how to identify target elements, generate selectors, and create reliable automations.
Before interacting with web elements, make sure you understand how browser sessions are created. See Browser Workflow.
Example Web Element Workflow
The diagram below shows a typical workflow structure for interacting with web elements inside a browser container:
Open Browser
│
└── Do
├── Wait Page Load Complete
├── Click
├── Type Into
└── Send Hot Keys
Picking Target Elements
The Pick target element helper allows you to select elements on a webpage directly from your screen:
- Click Pick target element.
- Hover over the target element.
- Click the element.
- akaBot Studio automatically generates a selector.
IMPORTANT
The akaBot Web Extension must be installed before selecting web elements. Without the extension, akaBot Studio cannot detect or capture elements from the browser.
Repicking Elements
If a webpage layout changes, or if you accidentally selected the wrong element:
- Click the Pick target element link in the activity body again.
- Re-select the correct element on the webpage. akaBot Studio will overwrite the previous selector with the new one.
Selectors & Selector Editor
When you pick a target element, akaBot Studio automatically generates a selector. You can review and modify the selector in the Selector Editor.
The Selector Editor contains:
- Attribute checklist: Checkboxes for attributes belonging to the selected element (e.g.,
id,class,aaname,tag). - Selector XML query: The resulting query used to search for the element at runtime.
Common Selector Attributes:
tag: The HTML element type (e.g.,INPUT,BUTTON,A,DIV).id: The unique identifier of the element.class: The styling class name of the element.aaname: The visible inner text or accessible name (excellent for buttons and text links).
Designing Stable Selectors
Some web elements use dynamic attributes that change every time the page loads. Avoid using these attributes because they may cause the selector to fail during execution.
Best Practices for Selector Stability:
- Deselect Unstable Attributes: Open the Selector Editor and uncheck boxes for dynamic, auto-generated, or temporary attributes (such as long numeric IDs or temporary state classes).
- Select Stable Attributes: Check static, reliable attributes. Using the accessible name (
aaname) or elementtagin combination with static classes creates a robust selector. - Use Wildcards:
- Use an asterisk (
*) to replace zero or more characters. For example,id='sm-12345'can be refined toid='sm-*'to match any auto-generated suffix starting withsm-. - Use a question mark (
?) to replace exactly one character.
- Use an asterisk (
See Also
Browser Activities
- Click
- Hover
- Type Into
- Send Hot Keys
- Check
- Select Item
- Select Multiple Items
- Get Text
- Get Web Attribute
- Wait Element Exist
- Element Exist
- Wait Web Attribute
- Wait Element Vanishes
- Extract Data
- Extract Structured Data