0

I a new to selenium and webdriver ,after going through i got to the below code for setting up the proxy and launch the browser:

String PROXY = "<<MY proxy>>";
org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY);
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new InternetExplorerDriver(cap);
driver.get("http://www.google.com");        
driver.quit();

Ran into the below issues:

1) Got the error attached below
2) I can see from the IE Proxy settings that the proxy string which i provided is present in a "proxy.pac" file but the proxy is not working. Even if i Stop the script and do manually
3) When i put the proxy string directly in the browser it works fine after i provide the credentials. Should i provide credentials? Can you please guide on how to do it?

Sep 5, 2012 3:59:52 PM org.openqa.selenium.browserlaunchers.WindowsProxyManager backupRegistrySettings
INFO: Backing up registry settings...
Sep 5, 2012 3:59:53 PM org.openqa.selenium.browserlaunchers.WindowsProxyManager      changeRegistrySettings
INFO: Modifying registry settings...
The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see   http://code.google.com/p/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://code.google.com/p/selenium/downloads/list
Sep 5, 2012 3:59:54 PM org.openqa.selenium.ie.InternetExplorerDriverServer initializeLib
WARNING: This method of starting the IE driver is deprecated and will be removed in selenium 2.26. Please download the IEDriverServer.exe from http://code.google.com/p/selenium/downloads/list and ensure that it is in your PATH.
Sep 5, 2012 3:59:58 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request: The target server failed to respond
Sep 5, 2012 3:59:58 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:D:\bin\java_shared\classes;D:\bin\java_shared\classes\jasmine.jar
Karel Frajták
  • 4,389
  • 1
  • 23
  • 34
Kumar
  • 57
  • 2
  • 7

1 Answers1

2

Have you read what the exception says? Your problem has nothing to do with the proxy. It's a problem with opening an instance of IE. You need to download IeDriverServer from Selenium's website and assign it's path to webdriver.ie.driver property.

You can read more about it in other topics:

Driver executable must be set by the webdriver.ie.driver system property

How do I setup the InternetExplorerDriver so it works

Community
  • 1
  • 1
JacekM
  • 4,041
  • 1
  • 27
  • 34
  • I posted this after trying the other options as well :( When i try the below code: – Kumar Sep 06 '12 at 11:04
  • Code: Proxy proxy = new Proxy(); proxy.setHttpProxy("http://setproxy.gsk.com//proxy.pac"); File file = new File("D:\\Selenium\\IEDriverServer.exe"); System.setProperty("webdriver.ie.driver", file.getAbsolutePath()); driver = new InternetExplorerDriver(); baseUrl = "http://www.google.co.uk/"; Error: Listening on port 15959 Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:D:\bin\java_shared\classes;D:\bin\java_shared\classes\jasmine.jar;'-Dname=javahowto' Strangely a browser opens up with url "Www.cfauth.com" – Kumar Sep 06 '12 at 11:09