FuckTheWorld / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

ChromeDriver appears to hang randomly #865

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description:
We have been running a smoketest suite with selenium and chromedriver for 
almost a year and about a week or two ago our tests just started hanging 
randomly. It doesn't happen everytime and in fact if we re-run our entire test 
suite it will go through sometimes.

I have included two debug logs from chromedriver one when it worked and one 
when it failed. If anyone has any ideas on what I could possibly be doing let 
me know.

Here is my java chromedriver startup code:

ChromeOptions options = new ChromeOptions();
    options.addArguments("--user-data-dir=" + cfg.getProperty("userProfile", Xforms.STRING));
    options.addArguments("--enable-extensions");
    options.addArguments("--start-maximized");
    options.addArguments("--disable-new-ntp");  // This was added to try to fix the random hangs and seems to happen less frequently with this flag enabled.
    options.addArguments("--test-type");
    options.addArguments("--profile-directory=" + cfg.getProperty("profileDirectory", Xforms.STRING));

    DesiredCapabilities capabilities = DesiredCapabilities.chrome();
    capabilities.setCapability(ChromeOptions.CAPABILITY, options);
    TestDriver.init(new ImplicitWaitDriverWrapper(new RemoteWebDriver(new URL(webDriverUrl), capabilities), 10L));

Original issue reported on code.google.com by tim95...@gmail.com on 29 Jul 2014 at 7:57

Attachments:

GoogleCodeExporter commented 9 years ago
I have also tried removing the implicit waits and that doesn't seem to help.

Original comment by tim95...@gmail.com on 29 Jul 2014 at 11:48

GoogleCodeExporter commented 9 years ago
It seems like it has to do with the chrome://newtab/ page as everytime if fails 
I see this line:

[8.520][DEBUG]: DevTools response: [ {

   "description": "",

   "devtoolsFrontendUrl": "/devtools/devtools.html?ws=127.0.0.1:12851/devtools/page/EED810F0-4B32-418F-9F9F-4D601FBB07B1",

   "faviconUrl": "chrome://extension-icon/aapnijgdinlhnhlmodcfapnahmbfebeb/24/1",

   "id": "EED810F0-4B32-418F-9F9F-4D601FBB07B1",

   "title": "Chrome Automation Extension",

   "type": "background_page",

   "url": "chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html",

   "webSocketDebuggerUrl": "ws://127.0.0.1:12851/devtools/page/EED810F0-4B32-418F-9F9F-4D601FBB07B1"

}, {

   "description": "",

   "devtoolsFrontendUrl": "/devtools/devtools.html?ws=127.0.0.1:12851/devtools/page/4F6370D3-467D-4CCB-B098-A2A891609A5A",

   "id": "4F6370D3-467D-4CCB-B098-A2A891609A5A",

   "title": "New Tab",

   "type": "page",

   "url": "chrome://newtab/",

   "webSocketDebuggerUrl": "ws://127.0.0.1:12851/devtools/page/4F6370D3-467D-4CCB-B098-A2A891609A5A"

} ]

and I never see it say chome://newtab/ in a successful run it always uses 

   "url": "chrome-search://local-ntp/local-ntp.html",

Original comment by tim95...@gmail.com on 7 Aug 2014 at 8:49

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:18

GoogleCodeExporter commented 9 years ago
Issue is not reproducible with chromedriver:2.15, chrome:v42, Windows 7

please try with latest versions and let us know if we differ from what you are 
trying

Sample Code
ChromeOptions options = new ChromeOptions();
                options.addArguments("--enable-extensions");
                options.addArguments("--start-maximized");
                options.addArguments("--user-data-dir=C:/Java/Chrome/ChromeAutoUserDir");
                options.addArguments("--profile-directory=Profile 2");

                //options.addArguments("--disable-new-ntp");
            options.addArguments("--test-type");
                DesiredCapabilities capabilities = DesiredCapabilities.chrome();
                capabilities.setCapability(ChromeOptions.CAPABILITY, options);

                for(int i=0;i<15;i++){
                        System.out.println(i+" iteration");
                WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),capabilities);
                driver.get("http://google.com");
                driver.quit();
                }

Original comment by ssudunag...@chromium.org on 20 Apr 2015 at 11:08

Attachments:

GoogleCodeExporter commented 9 years ago
tim95030

could you please reply to comment#4 and let us know if we differ form what you 
are doing.

Original comment by ssudunag...@chromium.org on 22 May 2015 at 11:28

GoogleCodeExporter commented 9 years ago
That seems to be roughly correct. We are using the url localhost:9515 for the 
web driver url. I haven't had a chance to update to 2.15 though. We also put in 
some f detection code for this issue so it hasn't been affecting us for a 
while. I will see what I can do to update and test it with the new version.

Original comment by tim95...@gmail.com on 22 May 2015 at 6:09

GoogleCodeExporter commented 9 years ago
tim95030@

did you get a chance to update and test with new version of Chromedriver 
2.15/2.16 ?

Original comment by agau...@chromium.org on 22 Jun 2015 at 1:24

GoogleCodeExporter commented 9 years ago
Yeah.  I have not seen this issue in a while.

Original comment by tim95...@gmail.com on 22 Jun 2015 at 4:32