Locate a field by its id
Automation taskEasyAsked in: Accenture, Capgemini, TCS, Wipro
The classic opener: "Which locator do you use first, and why?" An id should be unique on the page, it is short to write and easy to read, so it is the usual first choice. Find the field by its id and read one of its attributes (an attribute is a named value on an HTML element, such as placeholder="Email").