Terminates the web browser session, closing all open tabs.
UI element selectors
UI element selectors allow you to precisely identify and interact with specific elements on a web page. By using these selectors, your automation can locate buttons, text fields, and so on to perform actions like clicking, typing, or extracting data. We support a variety of selector types to ensure proper element identification.
Selector types:
ID
This selector targets an HTML element using its unique id attribute. This attribute is designed to be distinct within the entire HTML document.
When to use : It is ideal for elements that have a distinct and stable id. It's generally the most reliable and fastest selector when available.
Example: id="myLoginButton"
Name
This selector targets an HTML element using its name attribute. The name attribute is commonly used for form elements like input fields, radio buttons, and checkboxes.
When to use: It is useful for interacting with form controls, especially when multiple elements might share the same name (e.g., radio button groups).
Example: name="usernameField"
CSS Selectors
CSS selectors are patterns used to select and style HTML elements. It gives us a concise way to target elements based on their tag name, class, ID, attributes, or even their position relative to other elements.
When to use: It is useful when targeting elements based on their visual styling properties or common attributes. Often more readable and efficient than XPath for many common scenarios.
Example: div.product-card > h2.title (selects an h2 with class title that is a direct child of a div with class product-card)
XPath
XPath is a language for navigating and selecting elements within HTML (and XML) documents. It lets you locate elements by traversing the document's structure, using absolute or relative paths, attributes, text content, and complex conditions.
When to use: Useful for complex scenarios where other selectors might fall short. It can select elements that don't have unique IDs or classes, or elements based on their relationships to other elements in the DOM.
Example: //input[@type='text' and @placeholder='Enter your email'] (selects an input field with type 'text' and placeholder 'Enter your email')
Shadow DOMs
Shadow DOM is a web standard used to create encapsulated, hidden DOM structures. It involves three core components:
Shadow Host: A regular HTML element that contains the hidden Shadow DOM
Shadow Root: An isolated entry point attached by JavaScript to the Shadow Host, creating a separate DOM boundary.
Shadow Tree: The actual encapsulated HTML, CSS, and JavaScript content inside the Shadow Root.
All the HTML, CSS, and JavaScript inside this shadow tree remain separate from the main document's DOM, which prevents styling conflicts and improves reusability.
When to use: Necessary when interacting with elements that are part of a Shadow DOM. These elements are not directly accessible by standard selectors from the main document due to their encapsulated nature.
Note: When working with elements inside a Shadow DOM, you will need to use only XPath to the UI Element (i.e., Shadow Tree element). The selector type will be Shadow DOM, and the selector value should be the XPath to the element
Selector:
Enter the specific value of the corresponding selector type.