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-seleniumlibrary: latest
-
robotframework-faker: latest
-
robotframework-pabot: latest
-
Chrome webdriver: latest
-
Gecko webdriver: latest
-
Chrome browser: latest
-
Firefox browser: 74.0
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/*)
./robot test/
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: ./robot.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: ./robot.sh -V env/saucelabs.py
You can send parameters as part of pybot command line
e.g.
./robot -v URL:https://www.amazon.com -v BROWSER:firefox
This is sent to the container like this:
robot -v URL:https://www.amazon.com -v BROWSER:firefox --outputdir reports/