-
-
Notifications
You must be signed in to change notification settings - Fork 642
Issue with chromedriver when running Behat tests 1404 box version 1.1.7 #1152
Comments
Just for quicker reference:
Specifically:
Can you restart your VM ( |
@geerlingguy Tried to do a
|
I haven't encountered this issue in a while, but I'll try to run some of my other site's tests in the VM soon to see what's going on. It sounds like a Chrome/chromedriver issue in 14.04, since I don't think I've seen the error in 16.04 lately. |
Linking #1122 - could this be related? |
I am also getting this error
This is my default:
autoload:
'': %paths.base%/tests/features/bootstrap
suites:
listjs_views:
contexts:
- ListjsContext
- ListjsThemeContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\DrushContext
paths:
- %paths.base%/tests/features/listjs_theme.feature
extensions:
Behat\MinkExtension:
goutte: ~
selenium2: ~
browser_name: 'phantomjs'
base_url: "http://listjs.drupalvm.dev/"
Drupal\DrupalExtension:
blackbox: ~
region_map:
theme_list_wrapper: '.mykittens'
api_driver: 'drupal'
drush_driver: 'drush'
drush:
root: "/var/www/drupalvm/listjs"
drupal:
drupal_root: "/var/www/drupalvm/listjs"
chrome:
extensions:
Behat\MinkExtension:
javascript_session: 'selenium2'
browser_name: 'chrome'
show_cmd: "open %s"
selenium2:
wd_host: 'http://listjs.drupalvm.dev:4444/wd/hub'
browser: 'chrome' I have followed the docs, Acquia Blt code, this issue #367, I don't know what I am missing. Noob question: I don't have to execute selenium from the host right? The VM will run the selenium, and we have to connect the selenium in VM to the host machine's Chrome browser, and it will open up the dialog. Let me know if we can move this discussion to a separate issue. FYI Only the tests with |
Updated DrupalVM to the latest release 4.2.1 -- still no :( |
BTW I am getting this error on provisioning:
|
@subhojit777 - Are you executing tests inside the VM? e.g. where are you running the |
@geerlingguy Yes, inside the VM. I am executing the behat command inside the VM. |
I wonder if this is due to some other recent change in BLT... @subhojit777 and @devert - Is this with projects built with BLT, or derived from the Behat setup used by BLT? I have one project with BLT 8.6.6 running on Drupal VM 4.2.1, and I just ran a set of tests (both with and without
I have another project with BLT 8.6.11 running on Drupal VM 4.2.1, and I just ran a set of tests, and got:
But that seems like it's a different issue altogether... hrm, I haven't run the behat tests for this other project for a while, so I'll have to see what's going on. |
Various google searches suggest that this is the result of a version mismatch between chromedriver and selenium-server-standalone. |
In any case, it sounds like whatever the fix, it will need to be done in https://github.com/arknoll/ansible-role-selenium/issues |
Yay, I think I finally reproduced the error!
|
Doing some debugging based on this SE answer, which suggests the problem is "a mismatch between the versions of chromedriver and selenium-server-standalone".
So I'm using 2.27, which is the latest version of chromedriver according to http://chromedriver.storage.googleapis.com/LATEST_RELEASE (which the arknoll.selenium role uses to get the release version) and https://sites.google.com/a/chromium.org/chromedriver/downloads. Next up, what Chrome version is available?
So that all seems well and good, and highly compatible. Next up, Selenium. |
Looks like Test by adding |
Still not sure what's going on... if I do the steps in the comment above, I'm still not able to get my tests to pass; it looks like Selenium is still picking up 2.53.1 somehow! |
PR against Selenium role here: arknoll/ansible-role-selenium#30 |
oooooh... apparently The selenium version is locked into BLT at 2.53.0. So might need to be updated there as well! |
So...
But now I realize Ubuntu 14.04 defaults to Java 7 (OpenSDK 1.7), so I'm getting:
Need to upgrade Java to 1.8 to get latest version of Selenium working, since requirements may have been bumped? Ugh. |
Manual steps to upgrade from OpenJDK 7 to OpenJDK 8 on Ubuntu 14.04:
|
Looking better so far:
|
Yeah... but still no dice!
Now getting |
#1152 (comment) Re: No, it is not built using Blt. Are you running Selenium and Chromedriver from host or inside VM? |
#1152 (comment) Re: After upgrading to Selenium 3.0.1, I am also getting the same error. |
However headless testing with PhantomJS is working alright, it is just that the steps mentioned here #421 are not working for me :\ I will be writing a documentation for this once it is setup in my machine. Currently the Selenium integration docs are scattered, which makes it hard to follow. |
You may not need chromedriver/selenium if using PhantomJS. This role can install and configure a PhantomJS webdriver on port 4444 so is effectively a drop in replacement for selenium. Maybe something to include in DVM? |
I can continue with PhantomJS, but the documentation for taking screenshots was not working for me. My goal is - Run Behat tests in my local (VM/host), and view the UI (for debugging). That is all I need. I know PhantomJS is fast, but I am inclined towards Chromedriver + Selenium because it allows better debugging than screenshots. I want to make full use of this step https://github.com/jhedstrom/drupalextension/blob/master/src/Drupal/DrupalExtension/Context/DrupalContext.php#L427 (Then (I )break) |
@thom8 - Very true. I'd recommend upgrading to Ubuntu 16.04 or CentOS 7 if possible instead, then. Or maybe just wait another month or so and a new Chromedriver and Chrome release may 'just work'. |
@geerlingguy depends on the accuracy requirements of the tests, I prefer to run more tests more often in CI, and the speed difference it quite substantial. However, we're still planning to run nightly builds with selenium to pick up any shortfall. |
something like this works quite well in CI --
no JAVA required :) |
Opening this back up. We're taking a look at it at DrupalCon Baltimore. |
problem still present in the below configuration on a Drupal VM:
This is how it looks like process wise:
This is the error:
And this is the defunct chrome after the above error happens:
|
@marji - Thanks for confirming! It seems we still have yet to find the magical combination of chromedriver + chrome + behat drupal extension versions to make this work :/ |
@geerlingguy @marji I ran it through it's paces on Selenium 3.3.1 and 3.4, Chromedriver 2.28, and Chromedriver 2.22. All connection refused. I added my debug information as this appears to be a Chrome issue here: https://bugs.chromium.org/p/chromium/issues/detail?id=716175&can=2&start=0&num=100&q=chromedriver&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort= |
Opened another upstream issue for tracking purposes here: jhedstrom/drupalextension#370 I'm going to see if there's anything more I can do today, but I'm focused on a couple other issues at the moment, don't want to fork my brain too badly today! |
Has anyone tried headless chrome? |
Not sure but PhantomJS is no longer going to be maintained -- https://www.drupal.org/node/2869424 |
@thom8 - Yeah 😢 — thus I've re-opened this issue, since PhantomJS is probably not the best long-term workaround anymore. |
A workaround script with 100% compatible versions is below. Also, the same versions running successfully in Circle CI https://github.com/integratedexperts/behat-relativity/blob/master/circle.yml
|
Thanks @alexdesignworks Another option could be to include a role which installs docker then you'd be able to use docker selenium which is maintained by Selenium. This includes many prebuilt and more importantly pretested images -- https://github.com/SeleniumHQ/docker-selenium#docker-images-for-selenium-standalone-server-hub-and-node-configurations-with-chrome-and-firefox Maybe a |
@thom8 - ... it does exist :D https://galaxy.ansible.com/geerlingguy/docker/ The question would be then, would it be best to work on moving @arknoll 's role to use the docker container and depend on Docker being available? Or should I create a new selenium role that just uses the docker container? (Mostly that's a question to @arknoll about whether he'd like to keep his role more or less as-is, or whether he'd be okay with maybe switching to the container in a new major version... one problem is it would be practically impossible to getting such a setup working in CentOS, and probably Ubuntu 12.04 (which is technically no longer supported anyways)). |
@geerlingguy nice! Selenium is inside these containers so you only need to run it on port Note that you can use docker selenium now if you run docker/selenium/behat from your host machine, the difficulty would be using the drush driver from the host.. wonder if it supports aliases? also no JAVA required :) |
See related: Running Selenium with the new Headless Chrome |
I'd like to switch all the docs and examples to use Chrome in It looks like the changes we need to make are:
Read through the rest of the PR linked above for more specific changes. |
I encountered the same problem, but seemed to be able to resolve it without changing the configuration for Drupal VM. I am using 8.x of BLT with DrupalVM installed via BLT. Changing the robo command thats launches selenium to use
This also requires an extra line in the killSelenium() method to clean up xvfb after running:
Going to run a few more checks and then look at submitting a patch to BLT. [edit] Although it may be preferable to keep the robo task consistent and address the issue as indicated in the previous comment |
@geerlingguy how to
Trying to set this up without BLT using chrome |
I tried myapp:
extensions:
Drupal\DrupalExtension:
drupal:
# Site docroot inside Docksal.
drupal_root: /srv/myapp/docroot
drush:
# Site docroot inside Docksal.
root: /srv/myapp/docroot
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
Behat\MinkExtension:
browser_name: chrome
base_url: http://localhost
sessions:
default:
chrome:
api_url: "http://localhost:9222" Do you have any suggestions? |
@ArtuGit take a look at the example in BLT -- https://github.com/acquia/blt/blob/8.x/template/tests/behat/example.local.yml |
I'm going to close this particular issue as I think it's been beaten to death. Further work can be managed through this feature request ticket: #1598 |
Synopsis / Proposed Solutions
ubuntu1604
orcentos7
(or any other newer OS version base box).selenium
installed_extra).Basically, the bug seems to be upstream in either Google Chrome for Ubuntu 14.04, or in Chromedriver, as we've collectively spent a few dozen hours debugging everything (even trying Selenium 3.x and other exotic things), and nobody has figured out why the exact same configuration randomly stopped working in Ubuntu 14.04 sometime around the beginning of February.
Original Issue Description
Issue Type
Your Environment
Your OS
Full console output
https://gist.github.com/devert/e1f393ebb143fb8f5a6327fb2d267c42
Summary
After updating from 1.1.6 to the latest box
geerlingguy/ubuntu1404 (virtualbox, 1.1.7)
and reprovisioning the machine, I am now receiving an error when trying to run Behat tests. I wasn't recieving errors with chromedriver before.The text was updated successfully, but these errors were encountered: