cy.select() won't work, need to force and select twice
See original GitHub issueCurrent behavior:
cy.get('#element').select(value) //won't work
cy.get('#element').select(value, { force: true });
cy.get('#element').select(value, { force: true }); //only works calling twice, using force
Desired behavior:
cy.get('#element').select(value) //want it to work like this
Versions
Cypress 3.3.1 Chrome 74 Windows 10 x64
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:5 (2 by maintainers)
Top Results From Across the Web
select - Cypress Documentation
select() is an action command that follows the rules of Actionability. However, passing { force: true } to . select() will not override...
Read more >select react-select dropdown list option using cypress
On Cypress 4.2.0 and react-select 3.0.8 pressing enter twice is working for me:
Read more >cypress fix this problem, or use {force: true} to disable error ...
We have decided not to implement this {force: true} option because there is no way to retrieve the value from selected disabled options...
Read more >cypress-io/cypress - Gitter
I have tried several ways to select a value in my dropdown, but it won't work. ... doesn't work unfortunately, i get this...
Read more >Actions | Cypress examples (v7.1.0) - Gleb Bahmutov
To type into a DOM element, use the .type() command. ... close it cy.get('.action-btn') .click() .should('not.have.attr', ... Double click to edit.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jennifer-shehane, I’m also facing the same issue in cypress 8.3.0.
Here is a snippet using which you can reproduce the issue:
here drop-down is not selected on screen until I run line 2 twice. Cypress doesn’t show any error but the drop-down is also not selected on the browser.
I’m using Windows 10 Cypress 8.3.0
Please advise.
I see similar behavior, in cypress 8.5.0. I wait for the ajax call to load the select options and then sometimes it selects and sometimes it does not select. But it continues the test. Selecting it twice does not work, because on the second try i get an
detached from the DOM
. error.