Following should be the locator preference in Selenium automation scripting: 1. ID Locator 2. NAME Locator 3. CSS Locator 4. XPATH Locator 5. DOM Locator 1. ID (id) Locator: Select the ele…
Assert command in selenium:
This locator is start with current element. For example, xpath=//td[4] is the relative xpath locator for link22 element in below HTML code:
This locator is start with root element. For example, xpath=/html/body/table[@id='table1']/tbody/tr/td is the absolute xpath locator for link11 element in below HTML code:
ID (id) Locator: Select the element with the specified @id attribute.