Selenium WebDriver – How To Set Up Dockerized Selenium Grid in AWS / Cloud
We already have seen setting up JMeter Distributed Infrastructure using RancherOS. We will see how to manage dockerized selenium grid using RancherOS. Rancher helps us to set up the grid in the local machine / AWS / any cloud.
I would suggest you to read the above article on setting up the Rancher UI and adding AWS hosts etc.
Rancher – Stack:
Stack is a set of services to be run for the application. For the ‘Selenium Grid’ Stack, Lets assume we need below services.
- 1 selenium-hub container
- at least 1 chrome container – connected to the above selenium-hub container
- at least 1 firefox container – connected to the above selenium-hub container
Setting Up Selenium Grid:
- Go to Rancher UI – Stack screen to add a new Stack.
- I am going to call the stack as selenium-grid as shown here. [You could also upload your stack YAML config instead of setting up everything manually.]
- Once it is created, lets define the set of services we need. Click on the Add Service.
- I need the selenium-hub container first. I need to map the port 4444 of the container to the host port 4444.
- I am going to create a chrome container as shown here. It needs to be linked with selenium-hub container we had created. Repeat this step for firefox container as well.
- Now our grid-stack will look like this.
- Now click on the chrome/firefox to monitor, scale them up/down etc
- Rancher gives us an option to export the config in the YAML file for backup of our infrastructure.
- I could access the dockerized selenium grid in the cloud using http://[ip of hub]:4444/grid/console
Happy Testing & Subscribe 🙂
Categories: AWS / Cloud, CI / CD / DevOps, Docker, Selenium, Selenium Grid