Reputation: 59
Is there some way how to select same value in multiple forms (dropdowns)?
value I want to select -> apple every form is starting with -> dropdown_form_
I was thinking about something like:
cy.get('[id^="dropdown_form_"]').select("apple")
but this doesn't work, because you can only call select on single element.
Upvotes: 1
Views: 339
Reputation: 32044
Maybe you just want to apply .each()
command?
cy.get('[id^="dropdown_form_"]')
.each($el => {
cy.wrap($el).select("apple")
})
Upvotes: 1