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…
Let us consider a scenario, there are 4 login buttons on page with same id or ids are changing dynamically.
ID (id) Locator: Select the element with the specified @id attribute.