Hi all, My IE Browser was set proxy before. I want to set direct connection (no proxy) when initializing a new InternetExplorerDriver instance in run time. I can do it with FirefoxProfile but not with DesiredCapabilities. The code below just set specified proxy but not set no proxy. Could you please help me to set no proxy for InternetExplorerDriver? String PROXY = "localhost:8080"; org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy(); proxy.setHttpProxy(PROXY) .setFtpProxy(PROXY) .setSslProxy(PROXY); DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability(CapabilityType.PROXY, proxy); WebDriver driver = new InternetExplorerDriver(cap);
I would have something like that:
Proxy proxy = Proxy.NO_Proxy; DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new InternetExplorerDriver(cap);
Selenium version: 2.33 OS: Win 7 64 bit Browser: IE Browser version: 8,9 Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/3bc60fee-00f8-40e0-ab2b-e59dc0137286%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
(Error details: Unable to bind to port NNNN; timeout after 45000 milliseconds)
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZL%3DrweFpjmCTzGiSRNPtThAKV%3DzdzoEkxdGREgwckU8xvA%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/1ab006a7-a096-4547-b4c6-b460f22ea7a2%40googlegroups.com.
private static void proxySet ( final Browser browser, DesiredCapabilities desCaps, final String proxyServer ) {
Proxy py = new Proxy();
if ( StringUtils.isNotBlank( proxyServer ) ) {
// Use the specified proxy.
py.setHttpProxy( proxyServer );
py.setFtpProxy ( proxyServer );
py.setSslProxy ( proxyServer );
py.setNoProxy("");
} else {
// Workaround for Chrome as it does not seem to support setting the proxy to DIRECT so use a pass through proxy for now.
if ( browser == Browser.CHROME ) {
String proxyToUse = System.getProperty("default.proxy", "80.80.80.80:8080");
py.setHttpProxy( proxyToUse );
py.setFtpProxy ( proxyToUse );
py.setSslProxy ( proxyToUse );
py.setNoProxy("");
} else {
// Do not use a proxy.
py.setNoProxy( "DIRECT" );
desCaps.setCapability( CapabilityType.ForSeleniumServer.AVOIDING_PROXY, true );
desCaps.setCapability( CapabilityType.ForSeleniumServer.ONLY_PROXYING_SELENIUM_TRAFFIC, true );
desCaps.setCapability( CapabilityType.ForSeleniumServer.PROXYING_EVERYTHING, false );
}
}
Log.info ( "setting http proxy(" + py.getHttpProxy() + ")" );
desCaps.setCapability("ie.usePerProcessProxy", true);
desCaps.setCapability("ie.setProxyByServer", true);
desCaps.setCapability ( CapabilityType.PROXY, py );