SlideShare a Scribd company logo
RUN TESTS AT SCALE WITH
ON-DEMAND SELENIUM GRID
USING AWS FARGATE
Presenter:
Megha Mehta
Megha Mehta
Senior Automation Engineer
S&P Global Market Intelligence, Gurgaon
https://www.linkedin.com/in/m-mehta/
SPEAKER
mmehta.ten@gmail.com
@meghamehtatech
PROBLEM DESCRIPTION
• Slower feedback
• Hardware provisioning challenges
• Additional maintenance effort
• Challenges with cross-browser testing
• UI tests take long to run
• More expensive
• Longer waits for feedback
without parallelization
SLOWER FEEDBACK
HARDWARE PROVISIONING
CHALLENGES
• Performance of under-provisioned hardware suffers
under peak loads
• Avoid wastage due to over-provisioning by optimizing
capacity utilization
Application
stops
responding
Infrastructure
slow under load
Tests failed
• Frequent software upgrades and patches for system
efficiency
-Typical maintenance activities – browser upgrades, OS hotfixes,
security patches, system restart, disk cleanup etc.
• This takes focus away from testing
ADDITIONAL MAINTENANCE
EFFORT
CHALLENGES WITH CROSS-
BROWSER TESTING
CHROME 75 FIREFOX 60
FIREFOX 65
On different versions of same
browser
On different
browsers
SOLUTION
Auto-
provisioned
with minimal
maintenance
requirement
s
• Auto-
scalable in
response to
varying
load
• Reliable
and cost-
effective
Run tests in
hyper-parallel
mode for
faster
feedback
Dynamic and
quick to change
OUR SOLUTION
A dockerized Selenium Grid running on AWS
TAKEAWAYS
• Designing your own high-capacity Selenium Grid using
Docker and AWS
• A scalable yet disposable grid
• Faster feedback – reduce execution time from hours to
minutes
• Enable Continuous Integration
• Major cost savings compared to traditional on-prem
infrastructure
ARCHITECTURE DEEP DIVE
|WHY DOCKER CONTAINERS?
VMs
heavyweight
Take up lot of memory resources
Startup time in minutes
Containers
lighweight
Require lower memory
Startup time in seconds
SELENIUM GRID – HUB SETUP
• Hub should have High Bandwidth to support large
number of requests from test clients and nodes
• High CPU needed for 1000’s of tests but lower
memory is fine
• In our case, hub is single container of 16GB RAM, 4
vCPU
SELENIUM GRID – NODE SETUP
• Containers of 16 GB RAM, 4
vCPU
• Each container can run up to
20 browsers without any
performance hit
Docker Swarm AWS EKS
(Kubernetes)
AWS ECS/Fargate
Do we need to
provision instances in
advance?
Yes Yes No, automatically
done by AWS
Is it suitable for short
workloads?
Yes No, master node
always up
Yes
How cost-effective is
the solution? *
Charged for
provisioned EC2’s
Additional charges
for cluster
management
Charged only for
duration that
containers are
running
*Considering the container cluster only runs for a few hours
HOW TO MANAGE SO MANY
CONTAINERS?
Deciding
factors ↓
Orchestration
solutions 
CONTAINER ORCHESTRATION USING
FARGATE
• No need to provision, configure, or
scale clusters of machines to run
containers – unlike other orchestration
solutions
• Focus on designing and building
Selenium Grid instead of managing the
infrastructure that runs it
AWS Fargate
LOAD BALANCER
• Selenium Hub is behind an AWS LB
which listens to incoming requests
from clients and responses from
nodes on port 4444
• Domain Name System (DNS) name
received by the LB can be quite
complex and lengthy
- Use a friendly DNS name for load
balancer using AWS Route53
AWS Application
Load Balancer
AWS Route53
• ECR – AWS Elastic Container Registry to
store Docker images
• Official selenium-node images
modified to expose container IP to hub
for registration
CONTAINER_IP=$(curl -s http://169.254.170.2/v2/metadata
| jq -r '.Containers[1].Networks[0].IPv4Addresses[0]')
ECR – REPOSITORY FOR DOCKER
IMAGES
AWS ECR
VPC
Application Load
Balancer
Node containers - Chrome
Node containers -
Firefox
Autoscaling Group
Amazon ECR
Jenkins
Node
Jenkins
node
Jenkins
Node
AWS Fargate
Selenium Hub
Selenium Grid
• Monitor container metrics like CPU and memory utilization
during tests
• Scale out – add 2 node containers whenever CPU Utilization
> 80% for 2 min
• Scale down to ZERO if idle > 5 mins
AUTO-SCALING USING
CLOUDWATCH
VPC
Application
Load Balancer
Node containers - Chrome
Node containers -
Firefox
Autoscaling Group
AWS Fargate
Selenium Hub
Selenium Grid
Amazon ECR
Jenkins
Node
Jenkins
node
Jenkins
Node
CloudWatch
logs
Cloudwatch
Alarm [Triggered
on CPU
utilization >
80%]
CLOUDFORMATION – BRINGING IT
ALL TOGETHER
• Describe and provision all the
infrastructure resources using
CloudFormation template
• Version control/replicate/update
the templates like application code
AWS
CloudFormation
*Calculations shown for US East (N. Virginia) Region. Also, costs of other services like ECR, AWS ALB etc.
are not included.
COST BENEFITS
41 Fargate Containers (1 Hub +
40 Nodes, each of 4vCPU and
16GB configuration)
x
10 minutes to complete 800
tests
x
5 times a day
x
30 days in a month
= 1025 hours
~ $238.59 per month*
41 VMs
x
~ $80 per VM per month
~ $3280 per month
COST BENEFITS
$39360
$2856
Annual costs
Fargate containers On-prem VM
That’s a saving of ~93%!
SUMMARY
• Designing your own high-capacity Selenium Grid using
Docker and AWS
• A scalable yet disposable grid
• Faster feedback – reduce execution time from hours to
minutes
• Enable Continuous Integration
• Major cost savings compared to traditional on-prem
infrastructure
• Task networking in Fargate
https://aws.amazon.com/blogs/compute/task-networking-in-aws-fargate/
• Comparison between clusters
https://www.trinimbus.com/blog/fresh-reinvent-2017-aws-introduces-
elastic-container-service-kubernetes-eks-fargate
• FARGATE pricing calculator
http://fargate-pricing-calculator.site.s3-website-us-east-1.amazonaws.com/
REFERENCES
CLOUDFORMATION TEMPLATE
https://github.com/mmehta-
10/selenium-grid-fargate
THANK YOU!

More Related Content

What's hot (20)

PPTX
Test Automation in Agile
Agile Testing Alliance
 
PPTX
DevSecOps in the Cloud from the Lens of a Well-Architected Framework.pptx
Turja Narayan Chaudhuri
 
PPTX
AWS Well Architected Framework - Walk Through
Kaushik Mohanraj
 
PPTX
Automated Deployments
Martin Etmajer
 
PDF
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
PDF
TechnicalTerraformLandingZones121120229238.pdf
MIlton788007
 
PPTX
CI/CD on AWS
Bhargav Amin
 
PDF
Terraform: An Overview & Introduction
Lee Trout
 
PDF
Katalon Studio - A Codeless Automation Tool.pdf
Knoldus Inc.
 
PDF
[Azure Governance] Lesson 1 : Azure Naming Convention
☁ Hicham KADIRI ☁
 
PDF
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD
Julian Mazzitelli
 
PDF
JHipster on AWS
Gerard Gigliotti
 
PDF
Getting Started with Infrastructure as Code
WinWire Technologies Inc
 
PPTX
Agile Qa Framework Jacky Wu
Jacky Wu
 
PPTX
Azure DevOps
Felipe Artur Feltes
 
PPTX
EKS workshop 살펴보기
Jinwoong Kim
 
PDF
Data Driven Testing
Maveryx
 
PDF
Kubernetes
Meng-Ze Lee
 
PDF
Test Automation Framework Design | www.idexcel.com
Idexcel Technologies
 
PPTX
Migrating On-Premises Workloads with Azure Migrate
Dinusha Kumarasiri
 
Test Automation in Agile
Agile Testing Alliance
 
DevSecOps in the Cloud from the Lens of a Well-Architected Framework.pptx
Turja Narayan Chaudhuri
 
AWS Well Architected Framework - Walk Through
Kaushik Mohanraj
 
Automated Deployments
Martin Etmajer
 
IDC 서버 몽땅 AWS로 이전하기 위한 5가지 방법 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
TechnicalTerraformLandingZones121120229238.pdf
MIlton788007
 
CI/CD on AWS
Bhargav Amin
 
Terraform: An Overview & Introduction
Lee Trout
 
Katalon Studio - A Codeless Automation Tool.pdf
Knoldus Inc.
 
[Azure Governance] Lesson 1 : Azure Naming Convention
☁ Hicham KADIRI ☁
 
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD
Julian Mazzitelli
 
JHipster on AWS
Gerard Gigliotti
 
Getting Started with Infrastructure as Code
WinWire Technologies Inc
 
Agile Qa Framework Jacky Wu
Jacky Wu
 
Azure DevOps
Felipe Artur Feltes
 
EKS workshop 살펴보기
Jinwoong Kim
 
Data Driven Testing
Maveryx
 
Kubernetes
Meng-Ze Lee
 
Test Automation Framework Design | www.idexcel.com
Idexcel Technologies
 
Migrating On-Premises Workloads with Azure Migrate
Dinusha Kumarasiri
 

Similar to Run tests at scale with on-demand Selenium Grid using AWS Fargate (20)

PDF
TestWorks Conf Scalable QA with docker - Maarten van den Ende and Adé Mochtar
Xebia Nederland BV
 
PPTX
Kubernetes your tests! automation with docker on google cloud platform
LivePerson
 
PDF
Scalable QA With Docker
Maarten van den Ende
 
PPTX
Autoscaled Distributed Automation Expedia Know How
aragavan
 
PPTX
Autoscaled Distributed Automation using AWS at Selenium London MeetUp
aragavan
 
PPTX
Distributed Automation(2018) - London Test Automation in Devops Meetup
aragavan
 
PPTX
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
STePINForum
 
PDF
Automated-Testing-inside-containers
Manoj Kumar Kumar
 
PDF
Scalable Selenium cluster: up and running
Ivan Krutov
 
PDF
Scaling your Automated Tests: Docker and Kubernetes
Manoj Kumar Kumar
 
PPTX
Distributed automation selcamp2016
aragavan
 
PDF
Selenium grid workshop london 2016
Marcus Merrell
 
PPTX
Distributed automation sel_conf_2015
aragavan
 
PPTX
Selenium practical
Ruslan Strazhnyk
 
PPTX
Session on Launching Selenium Grid and Running tests using docker compose and...
Agile Testing Alliance
 
PPTX
Run UI Automation Tests using Selenium Grid and Azure Container Service (AKS)
Sri Kanth
 
PDF
Test Automation Infrastructure with Containers
Manoj Kumar Kumar
 
PDF
Testing kubernetes and_open_shift_at_scale_20170209
mffiedler
 
PDF
Selenoid
DataArt
 
PPTX
vodQA(Pune) 2018 - Docker in Testing
vodQA
 
TestWorks Conf Scalable QA with docker - Maarten van den Ende and Adé Mochtar
Xebia Nederland BV
 
Kubernetes your tests! automation with docker on google cloud platform
LivePerson
 
Scalable QA With Docker
Maarten van den Ende
 
Autoscaled Distributed Automation Expedia Know How
aragavan
 
Autoscaled Distributed Automation using AWS at Selenium London MeetUp
aragavan
 
Distributed Automation(2018) - London Test Automation in Devops Meetup
aragavan
 
Docker–Grid (A On demand and Scalable dockerized selenium grid architecture)
STePINForum
 
Automated-Testing-inside-containers
Manoj Kumar Kumar
 
Scalable Selenium cluster: up and running
Ivan Krutov
 
Scaling your Automated Tests: Docker and Kubernetes
Manoj Kumar Kumar
 
Distributed automation selcamp2016
aragavan
 
Selenium grid workshop london 2016
Marcus Merrell
 
Distributed automation sel_conf_2015
aragavan
 
Selenium practical
Ruslan Strazhnyk
 
Session on Launching Selenium Grid and Running tests using docker compose and...
Agile Testing Alliance
 
Run UI Automation Tests using Selenium Grid and Azure Container Service (AKS)
Sri Kanth
 
Test Automation Infrastructure with Containers
Manoj Kumar Kumar
 
Testing kubernetes and_open_shift_at_scale_20170209
mffiedler
 
Selenoid
DataArt
 
vodQA(Pune) 2018 - Docker in Testing
vodQA
 
Ad

Recently uploaded (20)

PDF
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
PPTX
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
PDF
Rethinking Security Operations - Modern SOC.pdf
Haris Chughtai
 
PDF
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
PDF
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
PDF
Trading Volume Explained by CIFDAQ- Secret Of Market Trends
CIFDAQ
 
PDF
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
PDF
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
PPTX
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
PDF
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
PPTX
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
PPTX
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
PDF
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
PDF
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
PDF
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
Productivity Management Software | Workstatus
Lovely Baghel
 
PDF
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
Rethinking Security Operations - Modern SOC.pdf
Haris Chughtai
 
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
2025-07-15 EMEA Volledig Inzicht Dutch Webinar
ThousandEyes
 
Trading Volume Explained by CIFDAQ- Secret Of Market Trends
CIFDAQ
 
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
Bitcoin+ Escalando sin concesiones - Parte 1
Fernando Paredes García
 
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Ampere Offers Energy-Efficient Future For AI And Cloud
ShapeBlue
 
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
Earn Agentblazer Status with Slack Community Patna.pptx
SanjeetMishra29
 
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
Empowering Cloud Providers with Apache CloudStack and Stackbill
ShapeBlue
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Productivity Management Software | Workstatus
Lovely Baghel
 
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
Ad

Run tests at scale with on-demand Selenium Grid using AWS Fargate

  • 1. RUN TESTS AT SCALE WITH ON-DEMAND SELENIUM GRID USING AWS FARGATE Presenter: Megha Mehta
  • 2. Megha Mehta Senior Automation Engineer S&P Global Market Intelligence, Gurgaon https://www.linkedin.com/in/m-mehta/ SPEAKER [email protected] @meghamehtatech
  • 3. PROBLEM DESCRIPTION • Slower feedback • Hardware provisioning challenges • Additional maintenance effort • Challenges with cross-browser testing
  • 4. • UI tests take long to run • More expensive • Longer waits for feedback without parallelization SLOWER FEEDBACK
  • 5. HARDWARE PROVISIONING CHALLENGES • Performance of under-provisioned hardware suffers under peak loads • Avoid wastage due to over-provisioning by optimizing capacity utilization Application stops responding Infrastructure slow under load Tests failed
  • 6. • Frequent software upgrades and patches for system efficiency -Typical maintenance activities – browser upgrades, OS hotfixes, security patches, system restart, disk cleanup etc. • This takes focus away from testing ADDITIONAL MAINTENANCE EFFORT
  • 7. CHALLENGES WITH CROSS- BROWSER TESTING CHROME 75 FIREFOX 60 FIREFOX 65 On different versions of same browser On different browsers
  • 8. SOLUTION Auto- provisioned with minimal maintenance requirement s • Auto- scalable in response to varying load • Reliable and cost- effective Run tests in hyper-parallel mode for faster feedback Dynamic and quick to change
  • 9. OUR SOLUTION A dockerized Selenium Grid running on AWS
  • 10. TAKEAWAYS • Designing your own high-capacity Selenium Grid using Docker and AWS • A scalable yet disposable grid • Faster feedback – reduce execution time from hours to minutes • Enable Continuous Integration • Major cost savings compared to traditional on-prem infrastructure
  • 12. |WHY DOCKER CONTAINERS? VMs heavyweight Take up lot of memory resources Startup time in minutes Containers lighweight Require lower memory Startup time in seconds
  • 13. SELENIUM GRID – HUB SETUP • Hub should have High Bandwidth to support large number of requests from test clients and nodes • High CPU needed for 1000’s of tests but lower memory is fine • In our case, hub is single container of 16GB RAM, 4 vCPU
  • 14. SELENIUM GRID – NODE SETUP • Containers of 16 GB RAM, 4 vCPU • Each container can run up to 20 browsers without any performance hit
  • 15. Docker Swarm AWS EKS (Kubernetes) AWS ECS/Fargate Do we need to provision instances in advance? Yes Yes No, automatically done by AWS Is it suitable for short workloads? Yes No, master node always up Yes How cost-effective is the solution? * Charged for provisioned EC2’s Additional charges for cluster management Charged only for duration that containers are running *Considering the container cluster only runs for a few hours HOW TO MANAGE SO MANY CONTAINERS? Deciding factors ↓ Orchestration solutions 
  • 16. CONTAINER ORCHESTRATION USING FARGATE • No need to provision, configure, or scale clusters of machines to run containers – unlike other orchestration solutions • Focus on designing and building Selenium Grid instead of managing the infrastructure that runs it AWS Fargate
  • 17. LOAD BALANCER • Selenium Hub is behind an AWS LB which listens to incoming requests from clients and responses from nodes on port 4444 • Domain Name System (DNS) name received by the LB can be quite complex and lengthy - Use a friendly DNS name for load balancer using AWS Route53 AWS Application Load Balancer AWS Route53
  • 18. • ECR – AWS Elastic Container Registry to store Docker images • Official selenium-node images modified to expose container IP to hub for registration CONTAINER_IP=$(curl -s http://169.254.170.2/v2/metadata | jq -r '.Containers[1].Networks[0].IPv4Addresses[0]') ECR – REPOSITORY FOR DOCKER IMAGES AWS ECR
  • 19. VPC Application Load Balancer Node containers - Chrome Node containers - Firefox Autoscaling Group Amazon ECR Jenkins Node Jenkins node Jenkins Node AWS Fargate Selenium Hub Selenium Grid
  • 20. • Monitor container metrics like CPU and memory utilization during tests • Scale out – add 2 node containers whenever CPU Utilization > 80% for 2 min • Scale down to ZERO if idle > 5 mins AUTO-SCALING USING CLOUDWATCH
  • 21. VPC Application Load Balancer Node containers - Chrome Node containers - Firefox Autoscaling Group AWS Fargate Selenium Hub Selenium Grid Amazon ECR Jenkins Node Jenkins node Jenkins Node CloudWatch logs Cloudwatch Alarm [Triggered on CPU utilization > 80%]
  • 22. CLOUDFORMATION – BRINGING IT ALL TOGETHER • Describe and provision all the infrastructure resources using CloudFormation template • Version control/replicate/update the templates like application code AWS CloudFormation
  • 23. *Calculations shown for US East (N. Virginia) Region. Also, costs of other services like ECR, AWS ALB etc. are not included. COST BENEFITS 41 Fargate Containers (1 Hub + 40 Nodes, each of 4vCPU and 16GB configuration) x 10 minutes to complete 800 tests x 5 times a day x 30 days in a month = 1025 hours ~ $238.59 per month* 41 VMs x ~ $80 per VM per month ~ $3280 per month
  • 24. COST BENEFITS $39360 $2856 Annual costs Fargate containers On-prem VM That’s a saving of ~93%!
  • 25. SUMMARY • Designing your own high-capacity Selenium Grid using Docker and AWS • A scalable yet disposable grid • Faster feedback – reduce execution time from hours to minutes • Enable Continuous Integration • Major cost savings compared to traditional on-prem infrastructure
  • 26. • Task networking in Fargate https://aws.amazon.com/blogs/compute/task-networking-in-aws-fargate/ • Comparison between clusters https://www.trinimbus.com/blog/fresh-reinvent-2017-aws-introduces- elastic-container-service-kubernetes-eks-fargate • FARGATE pricing calculator http://fargate-pricing-calculator.site.s3-website-us-east-1.amazonaws.com/ REFERENCES