-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cy.type() failed because it requires a DOM element. The subject received was: <window> The previous command that ran was: > cy.get() #16624
Comments
Can you provide the test code and an application to run this against to see the error (HTML file to visit). Thanks. |
Unfortunately, I cannot provide an application as it is highly
confidential, but it doesn’t not depend on application, you can easily try
it yourself by using the custom command I provided here for drop down type
of input.
…On Mon, May 24, 2021 at 9:43 PM Jennifer Shehane ***@***.***> wrote:
Can you provide the test code and an application to run this against to
see the error (HTML file to visit). Thanks.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#16624 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQSIXWS3P4DI5C7AJGFSAN3TPKM3TANCNFSM45JLBBGA>
.
|
I'm getting a similar error whilst using the withinIframe command
The test code is ^^above solved by adding a wait |
This is failing if I add should() before find(): Complete Code:
Error message: The subject received was:
The previous command that ran was:
All 2 subject validations failed on this subject. |
Was this resolved. I ran into a similar issue |
@samnittala no reply on this from Cypress folks. @jennifer-shehane , were you able to check my code above and try it out? |
The workaround I did was to convert the 2 lines into i.e should & and now becomes contains('title','Some Text'). |
Now you are using this?
|
CypressError The subject received was:
The previous command that ran was:
On testing stripe test card |
So there are a lot of different people commenting in here with different and unrelated issues, so it's hard to keep track of everything. I'm going to try and respond to people individually, but generally please make sure your comment is actually related to the original report, and doesn't simply happen to have the same error message for different reasons. @anywaynotme (original report)
This is a "Detached DOM error" - I'll direct you to #7306 for lots of discussion and related workarounds. We'll be resolving this sort of thing more permanently in Cypress 12, coming out later this month.
This is because some assertions change the subject. https://docs.cypress.io/api/commands/should#Yields:
You've run into this - This is super confusing behavior, I agree. I'd suggest opening a new issue to discuss changing this - I'm 100% on board that it shouldn't work like this, but it currently does. 🤷♀️
This is another detached DOM error. Pointing you to #7306 again. We have a fix for this which will go out in Cypress 12. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
I use the following custom command:
After I run the script in TypeScript format, i get the following error:
Desired behavior
No errors, everything should work like in a regular JS file, which works just fine
Test code to reproduce
launch the above mentioned command in a file with TS extension
Versions
Cypress version: the latest 7.3.0
The text was updated successfully, but these errors were encountered: