In one of my Selenium test cases, I try to ensure that certain pages can't be accessed. Instead, HTTP return code 403 should be given.
However, here Selenium terminates test execution with the following exception:
com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://user:[email protected]/admin Response_Code = 403 Error_Message = Forbidden
Any way to work around that?
Seems like I have to answer the question myself...
I now surround the "open" call with a try...catch block. There, I parse the exception message if it contains the 403 code and XHR ERROR. Seems to me not very clean, but it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With