The simple workaround is to write the response code to your response output. Finally we get to webdriver.
Is it possible to get the http response status code with selenium webdriver.
How to get response status code with selenium webdriver java. Let s review the different http status codes. It s not possible using the selenium webdriver api. Slckayhn oct 17 18 at 13 51.
It seems to be possible to get response status code from the log via api. I have written tests with selenium2 webdriver and want to test if http request returns an http 403 forbidden. For example on my 403 permission denied page i have.
In a word no. 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. 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. I have these selenium webdriver tests and i want to check if the http request returns any http 403 forbidden. You can also check for broken links on the site as you are executing selenium webdriver scripts.
How to get http response code using selenium webdriver. I m using java here as i haven t got much experience in python. Change user agent for selenium web driver.
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. Htmlunit already has this functionality but it s not been brought through to webdriver. Also i don t know how to get only the http status codes.
Check out the requests library in python. Can i get these http response status code with selenium webdriver. Maybe display it in the logger or save to a file.
I have written tests with selenium2 webdriver and want to test if http request returns an http 403 forbidden. This has been discussed ad nauseum in the issue tracker. 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.