user2021082
user2021082

Reputation: 11

select Multi-Value Select Boxes using cypress

I could not select Multi-Value Select Boxes (http://select2.github.io/select2/)

I try:

cy.get('s2id_e9').click()
cy.get('ul li:first').contains('California').select()

but it does not work.

How can I select these options? Hope someone can help?

Upvotes: 1

Views: 4153

Answers (2)

Judith lobo
Judith lobo

Reputation: 267

This worked for multi select dropdowns

  cy.get('[name="Optionwithcheck[]"]').select(['Option 2','Option 3'])

Upvotes: 1

Sergio Gragera
Sergio Gragera

Reputation: 816

cy.get('#s2id_e9 ul.select2-choices').click()
cy.contains('.select2-result-label', 'California').click()

Upvotes: 1

Related Questions