Docker container that runs Selenium Chrome and Firefox drivers in headless mode (no Xvfb required).
This repository has a Dockerfile that creates a Robot Framework image and a container to run Robot scripts locally, this image contains Chrome and Firefox browsers running in headless mode (no Xvfb required) and a ".py" file with settings to run local scripts in BrowserStack or Saucelabs services, BrowserStack and Microsoft have a partnership so you get unlimited execution time to run scripts against Microsoft Edge browser.
Your script repository must be checked out as a git submodule of this repository. https://git-scm.com/docs/git-submodule
-
robotframework: latest
-
robotframework-selenium2library: latest
-
robotframework-faker: latest
-
robotframework-pabot: latest
-
Chrome webdriver: 2.38
-
Gecko webdriver: 0.20.1
-
Chrome browser: latest
-
Firefox browser: 60.0.1
Docker should be already installed and running.
./build
This creates an image based on the Dockerfile then create a container sharing a volume between Docker and your local machine (robot-docker/*)
./run_test.sh
This creates a new container using the shared volume (created in step 1), it will run any Robot Suite that it's under robot-docker/ and logs, reports and screenshots will be stored in robot-docker/
./remove
Remove any container that belongs to the Robot Framework image and also Robot image is deleted.
-
Register at https://www.browserstack.com/
-
Get your username and key
-
Input those values in "browserstack.py" file
-
Run your tests: ./run_test.sh -V env/browserstack.py
-
Register at https://www.saucelabs.com/
-
Get your username and key
-
Input those values in "saucelabs.py" file
-
Run your tests: ./run_test.sh -V env/saucelabs.py
You can send parameters as part of pybot command line
e.g.
./run_test.sh -v URL:https://www.amazon.com -v BROWSER:firefox -V env/sitchrome.py
This is sent to the container like this:
pybot -v URL:https://www.amazon.com -v BROWSER:firefox -V env/sitchrome.py --outputdir reports/ --listener /opt/listener.py tests/