Skip to content
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

Selenium 3/Firefox #21

Open
welly opened this issue Nov 3, 2016 · 2 comments
Open

Selenium 3/Firefox #21

welly opened this issue Nov 3, 2016 · 2 comments

Comments

@welly
Copy link

welly commented Nov 3, 2016

Spent a little bit of time trying to figure out getting Selenium 3 working with Firefox to get behat tests with javascript working (using Firefox). Turns out it's pretty simple!

This role installs the latest version of Firefox which needs to use the GeckoDriver to operate with Selenium. You can download it from:

https://github.com/mozilla/geckodriver/releases

Secondly, installing Selenium standalone version 3.0.1 works with no configuration.

So, in my config.yml I have:

selenium_version: 3.0.1
selenium_install_firefox: yes

and I created a post-provision script which looks like:

#!/bin/bash

GECKO_VERSION="0.11.1"
GECKO_DOWNLOAD="https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v$GECKO_VERSION-linux64.tar.gz"
GECKO_DOWNLOAD_DIR="/tmp"
GECKO_NAME="geckodriver"
GECKO_PATH="/usr/local/bin"
GECKO_FULL_PATH="/usr/local/bin/$GECKO_NAME"

if [ ! -e "$GECKO_FULL_PATH" ]; then
wget -qO- $GECKO_DOWNLOAD | tar xvz -C $GECKO_DOWNLOAD_DIR
sudo cp -a $GECKO_DOWNLOAD_DIR/$GECKO_NAME $GECKO_PATH
else
exit 0
fi

This installs the driver in a location that selenium can find it. Simple as that and it appears to be working as expected.

@welly
Copy link
Author

welly commented Nov 3, 2016

Of course, this is a little bit redundant as I've since found out that this role is using chrome by default :) But still, might be of interest to someone!

@heddn
Copy link

heddn commented Feb 22, 2017

I found that the geckodriver has some significant bugs (for me) that make it unusable. So I have to use chrome until gecko gets more mature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants