Selenium + Java ·
8. Crafting High-Speed CSS Selectors
Prev
Next
Statement
Submissions
Solution
AI Help
8. Crafting High-Speed CSS Selectors
Listen
CSS Selector Patterns
- ID:
#checkout-btn
- Class:
.btn-primary
- Attribute:
button[data-testid='checkout-btn']
- Contains:
button[data-testid*='checkout']
Task
Write a CSS selector that targets a button with `data-testid="checkout-btn"`.
💡
Common doubts
Are CSS selectors faster than XPath?
Did you like the problem?
Lesson 8 of 18
Java
Reset
Copy
Loading code editor…
Submit
Next