1

Using Selenium's WebDriver, with PhantomJSDriver, I am trying to do headless browser testing. It works fine when connected to internet WITHOUT a proxy. But when the connection to internet is via an authenticated proxy, it fails. I want to deploy this program to multiple user sites, which might be connected to internet with or without proxy, and in case of proxy, it might be authenticated or unauthenticated.

Is there a way to tell Selenium Webdriver to use the "current" browser's internet connection settings? Please note I am using phantomjs.

Thanks, abbas

contactabbas
  • 832
  • 2
  • 11
  • 18
  • http://stackoverflow.com/questions/14699718/how-do-i-set-a-proxy-for-phantomjs-ghostdriver-in-python-webdriver you can try this – German Petrov Sep 08 '14 at 08:46

1 Answers1

0

There is some more simple but very effective solution, that I've used when battling with similar issues an year ago.

Do you have these issues when using other *Drivers? If not - my proposal is to use your implementation of any other *Driver that works fine and after it passes authentication just cast it to PhantomJSDriver. Please note that is just possible workaround if your TestFramework hierarchy is built to support such an action.

In addition you can consider the following - when I used such Polymorphism the difference is speed. For FirefoxDriver and PhantomJSDriver it wasn't such a pain and if you can use it only for authentication it will not slow you down noticeable.

I'm not sure that I can help you with my solution, but it will not hurt to try it.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
ekostadinov
  • 6,880
  • 3
  • 29
  • 47