Slckayhn oct 17 18 at 13 51. I have written tests with selenium2 webdriver and want to test if http request returns an http 403 forbidden.
It s not possible using the selenium webdriver api.
How to get response status code with selenium webdriver java. Is it possible to get the http response status code with selenium webdriver. If you ve written a few tests with webdriver already you re probably used to this api only there is no native support for inspecting response headers. This has been discussed ad nauseum in the issue tracker.
For example on my 403 permission denied page i have. It seems to be possible to get response status code from the log via api. How to get http response code using selenium webdriver.
Quite often when you are running automated checks with selenium webdriver you also want to check the response status code for a resource such as a web service or other web pages on the site. I have written tests with selenium2 webdriver and want to test if http request returns an http 403 forbidden. Is it possible to get the http response status code with selenium webdriver.
I have these selenium webdriver tests and i want to check if the http request returns any http 403 forbidden. Let s review the different http status codes. Check out the requests library in python.
Htmlunit already has this functionality but it s not been brought through to webdriver. Can i get these http response status code with selenium webdriver. I m using java here as i haven t got much experience in python.
Also i don t know how to get only the http status codes. Originally reported on google code with id 141 it would be useful to have methods to read the http status code and headers from an http response. Maybe display it in the logger or save to a file.
Possible duplicate of how to get http response code using selenium webdriver navarasu oct 17 18 at 13 28 you need to use another library for it. Finally we get to webdriver. Change user agent for selenium web driver.
You can also check for broken links on the site as you are executing selenium webdriver scripts. In a word no. The simple workaround is to write the response code to your response output.