New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protractor 5.1.1 doesn't work with Chrome 57 #4146

Closed
massimocode opened this Issue Mar 10, 2017 · 34 comments

Comments

Projects
None yet
@massimocode
Copy link
Contributor

massimocode commented Mar 10, 2017

(node:9828) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[11:48:42] I/launcher - Running 1 instances of WebDriver
[11:48:42] I/local - Starting selenium standalone server...
[11:49:12] E/launcher - Error: Error: Timed out waiting for the WebDriver server at http://10.10.10.76:45678/wd/hub
    at onError (C:\projects\JustEat.TopPlacement.ManagementWeb\src\JustEat.TopPlacement.ManagementWeb.ProtractorTests\node_modules\selenium-webdriver\http\util.js:102:16)
    at process._tickCallback (internal/process/next_tick.js:103:7)
[11:49:12] E/launcher - Process exited with error code 100

Protractor.conf.js looks like this:

    allScriptsTimeout: 30000,
    specs: [
        "./**tests/*.js"
    ],
    capabilities: {
        browserName: "chrome",
        chromeOptions: {
            args: ["--test-type", "--no-sandbox"],
        },
        loggingPrefs: {
            browser: "ALL"
        }
    },
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 5 * 60 * 1000
    },
@wswebcreation

This comment has been minimized.

Copy link
Collaborator

wswebcreation commented Mar 10, 2017

What version of Chrome is installed on your machine and which version of Chromedriver are you using?

@massimocode

This comment has been minimized.

Copy link
Contributor

massimocode commented Mar 10, 2017

Chrome is Version 57.0.2987.98 (64-bit)
Ran webdriver-manager update on protractor and apparently chrome driver version is chromedriver_2.28

@massimocode

This comment has been minimized.

Copy link
Contributor

massimocode commented Mar 10, 2017

Makes me think, could be a bug with chromedriver because that version should support 57+ according to this: https://sites.google.com/a/chromium.org/chromedriver/downloads

@wswebcreation

This comment has been minimized.

Copy link
Collaborator

wswebcreation commented Mar 10, 2017

What happens if you downgrade to chromedriver 2.27?

@massimocode

This comment has been minimized.

Copy link
Contributor

massimocode commented Mar 10, 2017

How can I do that?

@wswebcreation

This comment has been minimized.

Copy link
Collaborator

wswebcreation commented Mar 10, 2017

Depends, are you using a separate webdriver-manager?

I've installed it global, so I can do it like this webdriver-manager update --versions.chrome=2.27

You can see all the commands by using webdriver-manager, then all the commands are shown

@massimocode

This comment has been minimized.

Copy link
Contributor

massimocode commented Mar 10, 2017

Got it, will give it a try now

@massimocode

This comment has been minimized.

Copy link
Contributor

massimocode commented Mar 10, 2017

Seems to give the same error with chrome driver 2.27

@massimocode

This comment has been minimized.

Copy link
Contributor

massimocode commented Mar 10, 2017

In all honesty I'm not sure it's a chromedriver issue at all... when I run my E2E tests I can't even see the chromedriver process

@wswebcreation

This comment has been minimized.

Copy link
Collaborator

wswebcreation commented Mar 10, 2017

Updated my environment to:

  • webdriver-manager: 12.0.2
  • chromedriver: 2.28
  • Chrome: 57
  • Protractor: 5.1.1
  • Node: 7.5

And I don't have any problems, my tests are running normal

@massimocode

This comment has been minimized.

Copy link
Contributor

massimocode commented Mar 10, 2017

OK I managed to get it working using protractor 5.0.0 and manually installing chromedriver 2.28... But with protractor 5.1.1 it doesn't work

@aarr0n

This comment has been minimized.

Copy link

aarr0n commented Mar 13, 2017

So yeah this works, assuming protractor 5.0

gulp.task('protractor-install', function(done){
    child_process.spawn(getProtractorBinary('webdriver-manager'), ['update', '--versions.chrome=2.28'], {
        stdio: 'inherit'
    }).once('close', done);
});

jan-molak added a commit to serenity-js/tutorial-from-scripts-to-serenity that referenced this issue Mar 14, 2017

@jan-molak

This comment has been minimized.

Copy link
Contributor

jan-molak commented Mar 14, 2017

Protractor 5.1 seems happy enough, as long as the new version of ChromeDriver is used:

// package.json
"scripts": {
    "preprotractor": "webdriver-manager update --standalone --versions.standalone=2.53.1 --versions.chrome=2.28",
    "protractor": "protractor ./protractor.conf.js"
}

NickTomlin added a commit to NickTomlin/protractor-mcve that referenced this issue Mar 14, 2017

@NickTomlin

This comment has been minimized.

Copy link
Member

NickTomlin commented Mar 14, 2017

I'm unable to reproduce this using:

  • OSX 10.12.3
  • Chrome 57.0.2987.98
  • Selenium Webdriver 3.3.1
  • Chromedriver 2.28

Here's an example repo with passing tests.

What version of selenium standalone are you using?

@AlexDmr

This comment has been minimized.

Copy link

AlexDmr commented Mar 17, 2017

I got similar errors, I updated webdriver-manager and the chromedriver to 2.28. However, when I run protractor in my project it is keeping using chromedriver 2.25, I deleted node_modules and did another npm install but the problem remains.
I got "selenium-webdriver": "^3.3.0

----- The error I get when executing protractor protractor.config.js -----
[11:32:15] E/launcher - unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=57.0.2987.110)
(Driver info: chromedriver=2.25.426923 (0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT 10.0.14393 x86_64)

------ webdriver-manager status -----
webdriver-manager: using global installed version 12.0.4
[11:36:57] I/status - selenium standalone version available: 3.3.1 [last]
[11:36:57] I/status - chromedriver version available: 2.28 [last]
[11:36:57] I/status - geckodriver version available: v0.15.0 [last]
[11:36:57] I/status - IEDriverServer is not present
[11:36:57] I/status - android-sdk is not present
[11:36:57] I/status - appium is not present

@NickTomlin

This comment has been minimized.

Copy link
Member

NickTomlin commented Mar 17, 2017

@AlexDmr This is probably because you are using a global and not a locally installed version of webdriver-manager

------ webdriver-manager status -----
webdriver-manager: using global installed version 12.0.4
@NickTomlin

This comment has been minimized.

Copy link
Member

NickTomlin commented Mar 17, 2017

I'm going to go ahead and close this; it's working with the latest chromedriver and selenium standalone. Most issues should be resolved by ensuring that you are using the correct version of both.

@NickTomlin NickTomlin closed this Mar 17, 2017

@AlexDmr

This comment has been minimized.

Copy link

AlexDmr commented Mar 17, 2017

Indeed it works !
For those who would be in my case :
npm uninstall -g protractor
npm install -g webdriver-manager

clean your package.json so that you only keep a dependancy to protractor 5.1.1 (no dependency to webdriver-manager nor selenium).

Erase node-modules

npm install

Use the scripts provided by NickTomlin in the repo with passing tests

@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented Mar 17, 2017

I'm having the same issue on a Mac, and on Linux, running Chrome 57, but not on another mac, same exact protractor configs, but with chrome 56. This just started happening after updating.

@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented Mar 17, 2017

Reverted to Protractor 4.1.14, and chrome 56 (which is what I was using) and getting (on Linux):

[16:14:25] E/launcher - chrome not reachable
  (Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.0-67-generic x86_64)
[16:14:25] E/launcher - WebDriverError: chrome not reachable
  (Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.0-67-generic x86_64)
@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented Mar 17, 2017

And now, on the machine that was just working, I updated Chrome to 57, and now if fails the same way...

[15:27:45] I/launcher - Running 1 instances of WebDriver
[15:27:45] I/direct - Using ChromeDriver directly...
Started
F[15:28:10] E/launcher - chrome not reachable
  (Session info: chrome=57.0.2987.110)
  (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.11.6 x86_64)
[15:28:10] E/launcher - WebDriverError: chrome not reachable
  (Session info: chrome=57.0.2987.110)
  (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.11.6 x86_64)
@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented Mar 17, 2017

There's definitely an issue with protractor and chrome 57. I'm seeing the browser start, and start tests, but then blow up with the messages above.

I notice there's a new, annoying "Chrome is being controlled by automated test software", which I was able to turn off by passing the chromeOptions/args --disable-infobars. It's also asking to save passwords on every run... not sure how to disable that. Anyone?

So for the people that aren't seeing this behavior, what is in your config? :)

@NickTomlin

This comment has been minimized.

Copy link
Member

NickTomlin commented Mar 18, 2017

@qualityshepherd could you open a separate issue with a small reproducible example repository? I'm seeing the "Chrome is being controlled by automated test software" but that isn't impacting my tests running chrome 57.

@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented Mar 18, 2017

Yeah, Nick. Seems like I'm having multiple issues with Chrome 57 (and 56). I opened an issue for my linux issue. From the mac side, I'm still figuring it out. Chrome does crash for me, when I interfere with the running test, by trying to dismiss the "Chrome is being controlled..." infobar.

FWIW, Chrome v55 (which is the cutoff for Protractor v5x), works fine for me... in case that helps anyone else seeing this.

@NickTulett

This comment has been minimized.

Copy link

NickTulett commented Mar 19, 2017

@qualityshepherd To get rid of the password prompts (in a node.js client - please translate for your usage):
var prefs = utils.objectToMap({
"profile.password_manager_enabled": false,
"credentials_enable_service": false,
"password_manager_enabled": false
});
chromeOptions.setExperimentalOption("prefs", prefs);

@SRferrero

This comment has been minimized.

Copy link

SRferrero commented Mar 22, 2017

Un tour repo @NickTomlin I am getting thie error:

(node:96218) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. [13:11:50] I/launcher - Running 1 instances of WebDriver [13:11:50] I/direct - Using ChromeDriver directly... [13:11:51] E/launcher - session not created exception from disconnected: unable to connect to renderer (Session info: chrome=57.0.2987.110) (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.3 x86_64) [13:11:51] E/launcher - SessionNotCreatedError: session not created exception from disconnected: unable to connect to renderer (Session info: chrome=57.0.2987.110) (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.12.3 x86_64) at Object.checkLegacyResponse (/Users/s/Sites/testttt/node_modules/selenium-webdriver/lib/error.js:505:15) at parseHttpResponse (/Users/s/Sites/testttt/node_modules/selenium-webdriver/lib/http.js:509:13) at doSend.then.response (/Users/s/Sites/testttt/node_modules/selenium-webdriver/lib/http.js:440:13) at process._tickCallback (internal/process/next_tick.js:109:7) From: Task: WebDriver.createSession() at Function.createSession (/Users/s/Sites/testttt/node_modules/selenium-webdriver/lib/webdriver.js:777:24) at Function.createSession (/Users/s/Sites/testttt/node_modules/selenium-webdriver/chrome.js:709:29) at Direct.getNewDriver (/Users/s/Sites/testttt/node_modules/protractor/built/driverProviders/direct.js:76:33) at Runner.createBrowser (/Users/s/Sites/testttt/node_modules/protractor/built/runner.js:194:43) at q.then.then (/Users/s/Sites/testttt/node_modules/protractor/built/runner.js:338:29) at _fulfilled (/Users/s/Sites/testttt/node_modules/q/q.js:834:54) at self.promiseDispatch.done (/Users/s/Sites/testttt/node_modules/q/q.js:863:30) at Promise.promise.promiseDispatch (/Users/s/Sites/testttt/node_modules/q/q.js:796:13) at /Users/s/Sites/testttt/node_modules/q/q.js:556:49 at runSingle (/Users/s/Sites/testttt/node_modules/q/q.js:137:13) [13:11:51] E/launcher - Process exited with error code 199 npm ERR! Test failed. See above for more details.

I followed the steps from @AlexDmr so I only have webdriver globally and not protractor.

@dinvlad

This comment has been minimized.

Copy link

dinvlad commented Mar 23, 2017

chrome not reachable on my end as well with 57.0.2987.110. I'm running it with

  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      args: [
        "--headless",
        "--remote-debugging-port=9222",
        "--disable-gpu",
      ],
    },
  },
  directConnect: true,

Exactly the same args work well in Karma config, however Protractor doesn't seem to benefit from them. I'm running it on a headless Linux system (xvfb is not necessary anymore thanks to these options, at least with Karma).

EDIT: Also, ps aux shows that Chrome is started just fine and indeed includes these args:

/opt/google/chrome/chrome --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-gpu --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-automation --enable-logging --headless --ignore-certificate-errors --load-extension=/tmp/.org.chromium.Chromium.MOgA4I/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=9222 --safebrowsing-disable-auto-update --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.org.chromium.Chromium.5Z4S6y data:,
@dinvlad

This comment has been minimized.

Copy link

dinvlad commented Mar 24, 2017

UPDATE: removing "--remote-debugging-port" option from Protractor config (but not Karma!) solves the issue (understandably, because it interferes with ChromeDriver on that port)! I.e. Protractor 5.1.1 works with Chrome 57 on a headless system without Xvfb. #4164 (comment) if anyone is interested.

@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented Mar 24, 2017

Just for completeness, thanks to @NickTulett suggestion, you can turn off the password manager (and infobars) in Protractor thusly...

    capabilities: {
        browserName: 'chrome',
        chromeOptions: {
            args: [
                '--disable-infobars'
            ],
            prefs: {
                // disable chrome's annoying password manager
                'profile.password_manager_enabled': false,
                'credentials_enable_service': false,
                'password_manager_enabled': false
            }
        }
    },
@shane-reaume

This comment has been minimized.

Copy link

shane-reaume commented Apr 6, 2017

The above @qualityshepherd and @NickTulett works for me, thanks!

@mmk0126

This comment has been minimized.

Copy link

mmk0126 commented Apr 7, 2017

Thanks @qualityshepherd . It works for me.

@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented May 2, 2017

SOLVED:

Something changed in Chrome v56+ that now fails to start Chrome, when running tests as root on a linux server. Creating a new user, and running the tests as that user, fixed this. Also, add that user to sudo so you can start xvfb.

Fun times.

@mmk0126

This comment has been minimized.

Copy link

mmk0126 commented Mar 16, 2018

Hi @qualityshepherd ,

Again it causes the problem of hiding infobar. (Chrome is being controlled by automated test software.)
Just updated both Protractor and webdriver.
Protractor: 5.3.0
Chrome Driver: 2.37

Can anyone help here.

@qualityshepherd

This comment has been minimized.

Copy link

qualityshepherd commented Mar 16, 2018

Yeah, Chrome 65 now shows the infobar, with no apparent workaround. It caused my visual tests to fail. They also made a change to how you can workaround IDs starting with numbers... broke a couple tests there too. #thankschrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment