Aditya Garg delivered a session on "Launching Selenium Grid and Running tests using docker compose and maven – step by step demo" at #SeleniumSummit21
Aditya has over 25 years of IT experience and has been a test architect and principal consultant. Aditya is an Agile and DevOps coach and loves taking test automation and DevOps solutioning work. He is a ServiceNow enthusiast and loves everything about the tool.
To know more about #SeleniumSummit21 please check : https://seleniumsummit21.agiletestingalliance.org/
6. LITTLE BACKGROUND ON GRID
java -jar selenium-server-standalone-3.141.59.jar -role hub
java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-
standalone-3.141.59.jar -role node -hub
http://192.168.0.114:4444/grid/register/ -port 5555 -browser
browserName="chrome",version=ANY,platform=WIN10,maxInstances=5
It can get cumbersome
Have you
used
some of
these
command
s and
tried
creating a
Grid ?
7. STEPS THAT I WILL TRY TO DEMO
1
Launching simple Chrome Debug Selenium Grid, Running and Viewing
Tests
2 Launching simple Firefox Debug Selenium Grid, Running and Viewing
Tests
3 Using Docker-compose creating grid and running the tests
4 Running tests using Maven Plugin for docker-compose on the fly grid creation
and destruction
8. I am using an Ubuntu 16.04.6 VM
on a cloud with the following
setup.
- JDK 1.8
- Maven
- Docker
164.52.193.131
9. Selenium Test that I am going to use is
simple
1. Visit SeleniumSummit21 site
2. Wait for the title to have
#SeleniumSummit21
3. Go to speaker page
4. Get all the names of the speakers
22. docker-compose scale <service name> = <no of instances>
docker-compose scale chrome2 = 3
docker-compose up --scale chrome2=3 -d
Scaling nodes at run time
23. Demo 3 – Running tests on the selenium grid
created using docker-compose.yaml file
24. 4
Running tests using Maven
Plugin for docker-compose : on
the fly grid creation and
destruction while running the
tests
26. Demo 4 – Running tests on the selenium grid
created using docker-compose.yaml file, on the fly
by maven plugin.
This can now be part of any CI tool
Create and execute grids on demand..
27. SUMMARY
1
Launching simple Chrome Debug Selenium Grid, Running and Viewing
Tests
2 Launching simple Firefox Debug Selenium Grid, Running and Viewing
Tests
3 Using Docker-compose creating grid and running the tests
4 Running tests using Maven Plugin for docker-compose on the fly grid creation
and destruction