Web testing using Python 3 and Selenium
latest
View on Docker Hub
-
Based on: CentOS Linux
-
Packages installed:
- Git
- Python 3.6
- Google Chrome stable and Chromedriver
- Firefox and Geckodriver
- PhantomJS
- <other necessary packages>
-
Repositories installed:
- Extra Packages for Enterprise Linux (EPEL)
- IUS community repository
- Google Chrome stable
docker pull dpet23/selenium
-
Clone the repository, build the Docker image, and create a container
docker build -t dpet23/selenium:latest . docker create -it --name selenium dpet23/selenium
-
Copy the test Python scripts into the container
docker cp ./tests/. selenium:/tmp/
-
Run the container
docker start -ai selenium
-
Run a test script in the container
python3 /tmp/Chrome-headless.py
The expected output is:
=====[ START - CHROME ]===== Page title: "Welcome to Python.org" =====[ END - CHROME ]=====
-
Clean up
exit # from the container docker stop selenium docker rm -v selenium docker rmi dpet23/selenium