๐ฆLocators
Locators
Locators are used to identify web elements on a web page. They are used by WebDriver commands to find web elements.
๐ก Selenium command to operate on GUI elements; right-click the cursor anywhere to access the โInspectโ option
Locator Type | Description | Java Example |
---|---|---|
ID | Locates an element by its unique ID attribute |
|
Class Name | Locates elements by matching the CSS class name |
|
Name | Locates elements by the name attribute |
|
Tag Name | Locates elements by the HTML tag name |
|
Link Text | Locates anchor elements with exact link text |
|
Partial Link Text | Locates anchor elements with partial link text |
|
CSS Selector | Locates elements using CSS selectors |
|
XPath | Locates elements using XPath expressions |
|
Last updated