faint-ocean-92094
05/04/2023, 5:17 PMvar count = 100
for(var i = 0; i < count: i++) {
cy.visit("https://mypage.com")
}
Now at some point between 95 and 100 (because it depends on other tests that could visit this page more than once) the test will crash saying the page responded with a 405 and did not respond with 20x code. That all makes sense and it is the correct behavior.
My question is, what would be the correct way to stop the loop (or complete it, doesn't matter) when I get this response and just continue till the end so I land on the captcha page. I just need to verify the captcha appeared so it is pretty straight forward. I just can't make the failOnStatusCode: false because it is not a request block. Any recommendations?egray-kilobyte-89541
05/04/2023, 5:48 PMcy.request to ping the page and check the status code until the 405 is returned. You can use cypress-recurse to do this easilyfaint-ocean-92094
05/04/2023, 5:57 PMfaint-ocean-92094
05/04/2023, 5:58 PMfaint-ocean-92094
05/04/2023, 5:59 PMcy.visit("htttps://mypage.com", { failOnStatusCode: false }) seems to be the way 🤔 but it is not picking up, strange.