Created
October 21, 2019 20:08
-
-
Save Dema/dcc2b4f91b97ec9d56afc871e66fd3d7 to your computer and use it in GitHub Desktop.
Cypress recaptcha command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cypress.Commands.add("clickRecaptcha", () => { | |
cy.window().then(win => { | |
win.document | |
.querySelector("iframe[src*='recaptcha']") | |
.contentDocument.getElementById("recaptcha-token") | |
.click(); | |
}); | |
}); |
I have been trying to bypass the reCaptcha v2 on my system. I tried the above solutions and nothing seems to work.
Can someone please help me with a solution to bypass the image based reCaptcha?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is interesting. I was able to get it to work as well as the following code here:
However, the next day after a few tests it would not work and was not able to find the #recaptcha-token or the .its() would fail. This is what my team was seeing while reviewing a PR I'd created. I had set up the chromewebsecurity to false and was using the correct test keys provided by Google.
I ended up spending the entire day troubleshooting and trying to figure out what was happening. After a lot of frustrations, I hard reloaded and emptied the cache and now both versions of the click work!!! I have no clue why or what is going on frankly.