I am trying to run Protractor e2e tests inside a Vagrant VM using a headless Chrome. I managed to get it to work using Xvfb, but when I run the test to fill out the form, I get an error: unknown error: X-display is required to convert the code keys, think about using Xvfb
All tests run fine, but as soon as I use getKeys () (e.g. element (by.model ('user.email')). SendKeys ('admin');) I get this error, although I'm already using Xvfb.
I run:
- AngularJS sample application created by Yeoman angular generator - full glass
- Nodejs version 0.10.30 installed with nvm
- Vagrant 1.6.3
- VirtualBox 4.3.14
- Host OS Ubuntu 14.04 32 bit
- Ubuntu guest OS 14.04 32 bit
- chrome 37.0.2062.94
- chromedriver 2.10.267517
I use the following shell script to run Selenium and Xvfb:
#! / Bin / w
webdriver-manager start &
Xvfb: 1 -ac-screen 0 1280x1024x8 &
export DISPLAY =: 1
I also added "export DISPLAY =: 1" to / opt / google / chrome / google -chrome. Again, tests without sendKeys () work fine.
What i have done so far:
- I am running 32 bits of Ubuntu, so I downloaded chromedriver 2.10 32 bits, but that didn't help
- I ran a chrome reverse with --verbose and checked the logs, but this only shows the same error
- I searched for Xvfb screen size settings, didn't help
- I checked several source codes here: https://github.com/bayandin/chromedriver/blob/master/keycode_text_conversion_x.cc and found the error message on line 196. It fires when the gfx :: GetXDisplay () command (line 193) does not receive the display object. I suspect that this can only be the DISPLAY variable that I export to / opt / google / chrome / google -chrome, but I'm not sure and have no idea how to fix it.
I would like to know how I can get sendfkeys () working with Chrome headless inside Vagrant VM. Any help is appreciated.
source share