java.net.UnknownHostException - while executing scripts on chrome browser

551 views
Skip to first unread message

jsel...@gmail.com

unread,
Sep 10, 2014, 6:29:12 PM9/10/14
to browserm...@googlegroups.com
While executing tests on chrome browser 37 with Java 7 on selenium webdriver 2.39 with Browsermobproxy - 2.0-beta-9, i am getting 
java.net.unKnownHostException info message and test wouldn't move from the page and throws TimeOut Exception. 

This happening only on chrome fine on firefox and IE so far. Can you help me fixing it?

LOG - 

Sep 10, 2014 4:07:26 PM net.lightbody.bmp.proxy.util.Log info
INFO: java.net.UnknownHostException: https when requesting http://https//sp.analytics.yahoo.com/spp.pl?a=1000626285385&.yp=7330&js=no&gtmcb=100093218 // Not sure of this url.
FAILED: xxxx(Chrome, Windows7)
org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from renderer: 10.000
  (Session info: chrome=37.0.2062.103)
  (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 70.00 seconds
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'xxxxx', ip: '1xxxxxx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'
Session ID: fe0d6e600956884f45d480beddcf7a57
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\jpiduru\AppData\Local\Temp\scoped_dir5996_31907}, rotatable=false, locationContextEnabled=true, version=37.0.2062.103, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
Command duration or timeout: 70.10 seconds
Build info: version: '2.37.1', revision: 'a7c61cbd68657e133ae96672cf995890bad2ee42', time: '2013-10-21 09:08:07'
System info: host: 'xxxxx', ip: 'xxxxxx, os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'
Session ID: ba3a7d8e-3aec-4fc8-84ce-e06f72cbccfe
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\jpiduru\AppData\Local\Temp\scoped_dir5996_31907}, rotatable=false, locationContextEnabled=true, webdriver.remote.sessionid=ba3a7d8e-3aec-4fc8-84ce-e06f72cbccfe, version=37.0.2062.103, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, applicationCacheEnabled=false, takesScreenshot=true}]


// Chrome browser setup
public static WebDriver getChromeBrowser(OperatingSystem os)
throws Exception {
ProxyServer proxyServer = null;
proxyServer = new ProxyServer(9101);
proxyServer.start();

proxyServer.setCaptureContent(true);
proxyServer.setCaptureHeaders(true);

Proxy proxy = proxyServer.seleniumProxy();
proxy.setHttpProxy("localhost:9101");

DesiredCapabilities capability = null;
capability = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
options.addArguments(Arrays.asList("allow-running-insecure-content",
"ignore-certificate-errors"));
options.addArguments("test-type");
// configure it as a desired capability
capability.setCapability(CapabilityType.PROXY, proxy);
capability.setCapability(ChromeOptions.CAPABILITY, options);
capability.setBrowserName("chrome");
// capability.setPlatform(org.openqa.selenium.Platform.VISTA);
RunHost.runHost(capability);
Platform platform = setPlatform(os);
// OS setup
if (platform != null) {
capability.setPlatform(platform);
}
proxyServer.addRequestInterceptor(new RequestInterceptor() {
   @Override
   public void process(BrowserMobHttpRequest request, Har har) {
       request.getMethod().removeHeaders("User-Agent");
       request.getMethod().addHeader("User-Agent", "Bananabot/1.0");
       
   }
});
try {
RemoteWebDriver driver = new RemoteWebDriver(new URL(TestProperties
.getInstance().getProperty("hub.host", "")), capability);
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(60, TimeUnit.SECONDS);
return driver;

} catch (Exception e) {
e.printStackTrace();
}
return null;
}
// Main test

public class ABTest extends BaseClass{

public runTest(BrowserType browserType,OperatingSystem os)
{
WebDriver driver = getDriverByBrowserType(browserType,os);
driver.navigate().to(baseUrl);
}

}

Krishnan Mahadevan

unread,
Sep 11, 2014, 9:12:44 AM9/11/14
to browserm...@googlegroups.com
You might perhaps help provide a simple standalone test that can be executed to recreate the problem.

Also please dont forget to include what is your Selenium version (from your stacktrace it looks like you are using 2.39 (or) 2.37 ) and also the version of BMP you are using.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--

---
You received this message because you are subscribed to the Google Groups "BrowserMob Proxy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browsermob-pro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages