0
votes

I am using Selenium 2.8 with TestNG. I need to test usecases where I have to set custom referer header? I tried using addCustomHeader, but didnt work. I also tried selenium.start("addCustomHeaders=true") and then selenium.addCustomHeader("Referer", url) in my test. That didnt work either. Should I be using selenium as proxy. If so how to configure using Firefox and selenium java and how does it work. How to set the referer in that case? Does FirefoxDriver ease the job?

1

1 Answers

0
votes

You can try using the BrowserMob proxy for this. Probably you can find more info about support in Webdriver at https://sqa.stackexchange.com/questions/1276/is-there-a-capturenetworktraffic-implementation-in-selenium-2-via-webdriver

Check out the BrowserMob HTTP Request Manipulation section at https://github.com/lightbody/browsermob-proxy