We have a bunch of redirects in our Apache configuration. I would like to automate the testing of redirects with Selenium, which led me to some problems:
Maybe Selenium is not the best solution for this. Any other suggestions?
Selenium-RC has a traffic capture mode, defined as selenium.start("captureNetworkTraffic=true");
that will enable you to capture HTTP responses, including redirects and error codes.
Here is an excellent resource on how to capture and process/format this information once retrieved. It uses Python, though, but should give you a start.
For checking the URL of browser, you could use selenium.getLocation();
in python's implementation,
driver = webdriver.Firefox()
print driver.current_url
http://selenium.googlecode.com/svn/trunk/docs/api/py/webdriver_remote/selenium.webdriver.remote.webdriver.html#module-selenium.webdriver.remote.webdriver
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