← All topics
Quiz: Locators: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which CSS selector finds an input whose type is email?
- Q2. Which XPath finds the marks cell next to the cell containing "Neha"?
- Q3. What can XPath do that CSS selectors cannot?
- Q4. Why avoid absolute XPath like /html/body/div[2]/form/input[1]?
- Q5. What is the most robust locator you can ask developers for?
- Q6. How many locator strategies does Selenium's By class offer?
- Q7. Which CSS selector finds an input whose name starts with "pass"?
- Q8. Which XPath goes from the cell containing "Neha" up to its whole table row?
- Q9. Why is By.className often a poor choice?
- Q10. What does the XPath (//tr)[2] find?