-
Notifications
You must be signed in to change notification settings - Fork 725
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
Chromedriver support? #272
Comments
Firefox should be on there. Selenium should work. |
You can also use capybara-webkit if that's good enough unless you need the whole Chrome browser? |
Does that mean that I can also use jasmine-headless-webkit? I didn't realize the worker nodes supported the qt library |
Actually, there are good reasons to use Chromedriver as well as that stuff. @svenfuchs @joshk, whatcha think? The main issue with this is that it's an executable that needs to be in $PATH, not something that can be handled with a |
Couldn't you install Chromedriver in a But I am open to adding it to the standard box if someone writes up a cookbook? |
I ended up trying something like this: steveklabnik/compatriot@22a7c5f Gives me some sort of strange error, though: https://github.com/clnclarinet/compatriot/pull/3 Maybe it's related to using it with I'll re-close, since I discovered a workaround, at least. |
@joshk I am doing the following to install Chrome, so we can use ChromeDriver:
But this fails; it looks like Chrome needs some dependencies which it can't find:
Do you see any workaround? |
OK, I got to install Chrome on Travis-CI with:
See: (Credits go to @evlist for getting this right.) |
Awesome, thanks for figuring this out. Would someone be interested in helping add this to our cookbooks? https://github.com/travis-ci/travis-cookbooks/tree/master/ci_environment/chromium On 5/03/2013, at 9:07 AM, Alessandro Vernet notifications@github.com wrote:
|
<3<3<3 On 7/03/2013, at 12:29 AM, Gilles Cornu notifications@github.com wrote:
|
@joshk The thing is that I wanted to install Chrome to be able to use ChromeDriver in automated tests, and even with Chrome properly installed, ChromeDriver is still hanging, and I still haven't figured that one out, and haven't seen anyone successfully running ChromeDriver on Travis-CI. So in a way, this issue on running ChromeDriver on Travis-CI is still "open". |
Drat, that is annoying :/ I am not sure of the solution tbh. Does anyone have any ideas and thoughts about this? On 7/03/2013, at 6:54 AM, Alessandro Vernet notifications@github.com wrote:
|
@avernet there is indeed a problem when installing One more question to you @avernet: Could you also integrate with |
One more bad news: beside apt installation issue, it is currently not possible to execute chrome and chromium on new bluebox machines (Chrome cannot be executed in OpenVZ container). See #938. |
@gildegoma I managed to install Chrome on Travis-CI by adding these 4 commands to install Chrome to the |
@gildegoma Good to know; hopefully will can get fixed/implemented/supported soon. As a workaround, for open source projects who really want to test with Chrome, one option is to use Sauce, which will allow you to run your tests on any browser. |
@avernet sure, Travis for server-side and SauceLabs for client-sides is an awesome combination! You should actually check (if not already done) upcoming improvement from @henrikhodne: travis-ci/travis-build#88 and be ready to update your On the other hand, #938 sounds very hard to be fixed (without a little help of Google...). 😒 |
It would be good to have a way of using chromedriver, as per the issue title: |
Has anybody succeeded in debugging the issue? I still get this error
Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver.
|
Hi @reach2jeyan it seems that new Linux version comes with Chrome pre-installed, you can see an example here:https://github.com/antonsamper/gulp-webpack-boilerplate/blob/master/.travis.yml Hope it helps! |
@LaiaPR Thanks! I ll try this out and let you know. |
@LaiaPR I still get the error
My latest
|
@LaiaPR I updated my
My
PFB the raw log https://api.travis-ci.org/jobs/201469568/log.txt?deansi=true |
@LaiaPR I tried pushing a feature file and it seems like now the error is, it cannot access
|
@LaiaPR Finally I could pass the https://api.travis-ci.org/jobs/201587885/log.txt?deansi=true
|
@LaiaPR Finally! I am able to run it. Looks like the issue with Thanks |
It is even simpler now. sudo: required
dist: trusty
language: ruby
rvm:
- 2.2
before_install:
- sudo apt-get update
- sudo apt-get install chromium-chromedriver
before_script:
- "export PATH=$PATH:/usr/lib/chromium-browser/"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start From: https://github.com/zeljkofilipin/mediawiki-selenium-rb/blob/master/.travis.yml |
* dev: 1.12.0 update deps yarn protractor side config-const new side module proper mini component bower updates #511: component sub-generator - test file and updated main.scss component-subgenerator: basic implementation Revert "break build" break build turn slack integration back on turn slack integration back on #511 component sub-generator - mini component example Revert "#487 travis, run protractor - give it another go travis-ci/travis-ci#272 (comment)" #487 travis, run protractor - give it another go travis-ci/travis-ci#272 (comment) #495 travis, mattermost - also add gitter webhook #495 travis - mattermost integration
Okay.. I am confused how to support headless mode while using chromedriver WITHOUT XVFB. I am trying to run Chrome in headless mode. Here is my travis.yml sudo: required
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
language: python
python:
- "2.7"
before_install:
- wget https://chromedriver.storage.googleapis.com/2.30/chromedriver_linux64.zip -O /tmp/chromedriver
- chmod 777 /tmp/chromedriver
install:
- python setup.py develop
env:
- CHROME_DRIVER_PATH=/tmp/chromedriver
script: pytest Here is my code in Python. def setup_browser():
"""Returns a Chrome browser instance."""
try:
driver_path = os.environ["CHROME_DRIVER_PATH"]
except KeyError as e:
raise KeyError("Expect CHROME_DRIVER_PATH as environment variable")
chrome_options = SOptions()
chrome_options.add_argument("--headless")
return webdriver.Chrome(driver_path, chrome_options=chrome_options) This code works on local. Travis failed with: _____________________________ test_non_exist_gmail _____________________________
non_exist_gmail = 'name.taken.yet.test.b60f5f51@gmail.com'
def test_non_exist_gmail(non_exist_gmail):
> result = check_account_exists(non_exist_gmail)
tests/test_check_gmail.py:39:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name_taken_yet/check_gmail.py:41: in check_account_exists
with open_browser(GMAIL_SIGNUP_URL, account_name) as browser:
/opt/python/2.7.13/lib/python2.7/contextlib.py:17: in __enter__
return self.gen.next()
name_taken_yet/check_gmail.py:31: in open_browser
browser = setup_browser()
name_taken_yet/check_gmail.py:27: in setup_browser
return webdriver.Chrome(driver_path, chrome_options=chrome_options)
../../../virtualenv/python2.7.13/lib/python2.7/site-packages/selenium-3.4.3-py2.7.egg/selenium/webdriver/chrome/webdriver.py:62: in __init__
self.service.start()
../../../virtualenv/python2.7.13/lib/python2.7/site-packages/selenium-3.4.3-py2.7.egg/selenium/webdriver/common/service.py:96: in start
self.assert_process_still_running()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.chrome.service.Service object at 0x7f4bfb0ad090>
def assert_process_still_running(self):
return_code = self.process.poll()
if return_code is not None:
raise WebDriverException(
'Service %s unexpectedly exited. Status code was: %s'
> % (self.path, return_code)
)
E WebDriverException: Message: Service /tmp/chromedriver unexpectedly exited. Status code was: 1
../../../virtualenv/python2.7.13/lib/python2.7/site-packages/selenium-3.4.3-py2.7.egg/selenium/webdriver/common/service.py:109: WebDriverException
=========================== 3 failed in 3.16 seconds =========================== I appreciate if someone can provide me a pointer. |
@yeukhon make sure chrome/chromium 59 is installed. I think this is the first version that supports headless mode. |
@zeljkofilipin I guess it makes sense to have it available in the container builds too, fyi travis-ci/apt-package-safelist#4268 |
@codingjoe I believe it has been whitelisted. The following worked for me for testing with Selenium in python, with sudo disabled (thanks to https://gist.github.com/thotmx/046b6fa582f0725dc783 for the idea):
The last part is needed because Selenium requires chromedriver in the PATH. Oh and you'll need to add the |
@Dantemss I just check it has not been whitelisted. Also I authored the PR that would whitelist it. Therefore I don't see how your config could actually work. Can you send me a link to a travis-ci build where the config you posted works? |
@codingjoe not sure if you are still looking for a link but here is a build that worked using @Dantemss config: |
Would be nice if we could have chromedriver and/or firefox for ui testing.
The text was updated successfully, but these errors were encountered: