Cypress · Junior · Question 15 of 75

How do you tick a checkbox in Cypress?

Show the answer

Correct answer: cy.get('[type=checkbox]').check()

Explanation

.check() and .uncheck() work for checkboxes and radios and can take values to pick specific ones.

Further reading

Problem with a question

Cypress · Junior · question 15

Test yourself

Take the Cypress · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz