Set up selenium and Firefox for running selenium tests.
java
selenium_install_dir
: [default:/opt
] Install directoryselenium_version
: [default:2.53.0
] Install versionselenium_install_firefox
: [default:no
] Whether to install FireFoxselenium_install_chrome
: [default:yes
] Whether to install Google Chrome
None
---
- hosts: all
roles:
- selenium
$ service selenium start
$ service selenium stop
$ service selenium restart
For some OS combinations the package manager version of Firefox doesn't work appropriately with Selenium. In these circumstances you may see an error like:
WebDriver\Exception\UnknownError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Chrome and chromedriver don't appear to have this issue. If possible, use Chrome. If you still want to use firefox, then I suggest using https://galaxy.ansible.com/arknoll/firefox/ to install an older version of firefox. (38.0 worked for me on Ubuntu 16.04).
Author:: Alex Knoll ([email protected])
Copyright:: 2015, Alex Knoll
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
We welcome contributed improvements and bug fixes via the usual workflow:
- Fork this repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new pull request