cypress: 3.5.0 - CypressError: Timed out retrying: Cannot read property 'defaultView' of null
When I attempt to use a .select() on a <select> object, I am getting the posted error.
This is only the case when attempting to select something from the dropdown that DOES exist on the list. If I attempt to select a value that doesn’t exist, I get the standard
Cypress error "CypressError: Timed out retrying: cy.select() failed because it could not find a single <option> with value or text matching...".
I have previously been using this exact test successfully, and something must have changed causing it to error out. I find that even if I comment out this portion, similar errors follow with other commands later in the test.
This is the stack trace for the error.
CypressError: Timed out retrying: Cannot read property 'defaultView' of null
at Object.cypressErr (http://app.locals/__cypress/runner/cypress_runner.js:104836:11)
at Object.throwErr (http://app.locals/__cypress/runner/cypress_runner.js:104791:18)
at Object.throwErrByPath (http://app.locals/__cypress/runner/cypress_runner.js:104823:17)
at Object.retry (http://app.locals/__cypress/runner/cypress_runner.js:96197:16)
at retryActionability (http://app.locals/__cypress/runner/cypress_runner.js:84998:19)
From previous event:
at tryFn (http://app.locals/__cypress/runner/cypress_runner.js:96655:21)
at whenStable (http://app.locals/__cypress/runner/cypress_runner.js:96690:12)
at http://app.locals/__cypress/runner/cypress_runner.js:96240:16
I cannot seem to find anything called defaultView except within jQuery itself. I have tried searching this space for an answer, but cannot seem to figure out what the deal is.
The code that causes this error is:
cy.get('#inputDoctors').select(physicianName);
The get is successful, and I can confirm that element exists and the value is a valid option.
Steps to reproduce:
I believe that this error is somehow project internal, which for many reasons cannot be completely shared. However, I will create a very simple idea of what is going on:
<select id="inputDoctors>
<option value="Doctor1">apples</option>
<option value="Doctor2">oranges</option>
<option value="Doctor3">bananas</option>
</select>
cy.get('#inputDoctors').select('Doctor1'); --> Fails with defaultView Error
cy.get('#inputDoctors').select('Doctor15'); --> Fails with cannot find value error
I understand it may be hard to help debug, but really anywhere you can point us to to start debugging this error is greatly appreciated.
Versions
Cypress: 3.5.0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 27 (7 by maintainers)
Commits related to this issue
- fix(e2e): pin cypress to 3.4.1 See cypress issue here: https://github.com/cypress-io/cypress/issues/5449 — committed to vuejs/devtools by deleted user 5 years ago
- EUX-1942 Nedgradering av cypress * Mest sannsynlig tredjeparts depecency jQuery feil se issue https://github.com/cypress-io/cypress/issues/5449 * Rettet liten feil i rereranse til en kode i en av test... — committed to navikt/eux-web-app by Castigere 5 years ago
I am also seeing
CypressError: Timed out retrying: Cannot read property 'defaultView' of nullin Cypress 3.5.0 when interacting with an iframe input. The same code does not generate an error in Cypress 3.4.1. I know iframes aren’t natively supported right now but any tips would be helpful.Custom command to interact with iframe elements (this still successfully selects buttons in the iframe):
Code to enter username in the username in the iframe input field :
Adding to this thread, I also just upgraded to 3.5 and can no longer complete Stripe payment iFrames.
Returns the same error:
@ashley-maiden I am also having the same error when accessing an iFrame on 3.5.0 worked fine on 3.4.1 I’m not sure if the issue is the Electron bump or jQuery upgrade
I was able to reproduce and am working on a fix
Hi, got same error with stripe form during payment. Cypress can fill 2 fields of 3 and throw this error
Released in
3.6.0.Same issue here. This test fails on 3.5.0 with the above error. I rolled back to 3.4.1 and it passes:
Probably not Electron, the same failure happens in Chrome.
yeah I’ve been getting the same issue too in my Stripe payment iFrames, the tests were fine and after the upgrade to 3.5.0 they just stopped working, rolled back to 3.4.1 and they work perfectly again, might be right with the JQuery upgrade @daniel-ogunnaike