Cypress · Junior · Question 14 of 75
How do you select an option in a native <select>?
- 1
cy.get('select').type('Blue') - 2
cy.get('select').choose('Blue') - 3
cy.get('select').select('Blue')
Show the answer
Correct answer: cy.get('select').select('Blue')
Explanation
.select() accepts the option's text, value or index. Custom dropdowns are tested with clicks.