ERR_EMPTY_RESPONSE in Chrome when use BrowserMobProxy for selenium test -
i've created simple method network traffic chrome:
public void savenetworktraffic() { system.setproperty("webdriver.chrome.driver", system.getproperty("user.dir") + "/bin/chromedriver"); string sfilename = "networklog.xar"; browsermobproxy proxy = new browsermobproxyserver(); proxy.start(0); proxy seleniumproxy = clientutil.createseleniumproxy(proxy); desiredcapabilities capabilities = new desiredcapabilities(); capabilities.setcapability(capabilitytype.proxy, seleniumproxy); webdriver driver = new chromedriver(capabilities); webdriverrunner.setwebdriver(driver); proxy.enableharcapturetypes(capturetype.request_content, capturetype.response_content); proxy.newhar("google.com"); driver.get("http://google.com/"); har har = proxy.gethar(); file harfile = new file(sfilename); try { har.writeto(harfile); } catch (ioexception ex) { system.out.println(ex.tostring()); system.out.println("could not find file " + sfilename); } }
when browser opens page shows error "err_empty_response" on step driver.get("http://google.com/")
instead of usual google page in chrome. i've tried figure out reason error, according https://github.com/lightbody/browsermob-proxy#using-with-selenium, code should work fine.
Comments
Post a Comment