Locate an element by its name attribute
Automation taskEasyAsked in: Accenture, Capgemini, TCS, Wipro
Form fields often have a name attribute, because the form sends that name to the server with the value. Interviewers ask you to list the locator strategies and say when you use each; name is the usual second choice after id. Here you find a read-only field by its name and print its value and tag name.