SlideShare a Scribd company logo
Cross Browser Testing using Selenium GRID
Blogs
Cross Browser Testing using Selenium GRID
One of the challenges that we face while testing the application is testing
it on different browsers and environments. We all might have observed
that some websites are not properly displayed on some browsers and
we just think that the website is broken. But, as soon as you open it on a
different browser, the website opens up just fine. Thus, this behavior
explains the compatibility of a website with different browsers.
 Kiran HS, CoffeeBeans
Each browser interprets the information on the website page differently,
so, some browsers may lack the features that your website is trying to
show and make your website look broken on that browser.
That being the brief story, I bet you all have figured out the topic of
today’s discussion—Cross Browser Testing. So what is cross
browser testing?
Cross browser testing is a type of testing that lets you check whether the
websites are working as intended when accessed through
 Different Browser—OS combination
 Browsers like—Chrome, Firefox, Safari, Edge, etc
 Operating Systems like—Windows, Linux, MAC, etc
It’s about shipping releases that are as browser-agnostic as possible,
which is key to delivering a uniform user experience on a diverse, ever-
growing range of browsers/devices.
As a tester, it is your responsibility to make sure that not only do
applications work, but they work for all your users, no matter what
browser, device, or additional assistive tools they are using. Now comes
the next question -
Why cross browser testing?
1. To check how the website appears on different browsers
2. To check how the website works on different browsers ( quite
obvious )
3. To ensure that you’re not alienating a significant part of your target
audience–simply because your website does not work on their
browser OS.
The next question which comes to mind is -
How to perform cross browser testing?
This can be done in two (obvious) ways
1. Manual Approach (Manually check the functionality on different
browsers and platforms, painful process to follow)
2. Automation Approach (Write one piece of code and run it on
different browsers and platform combinations—sounds cool and
easy right?)
That being said, let’s dive into the automation approach and see how
this can be achieved with Selenium, Selenium GRID, and TestNG
Firstly, you will need to set up a selenium grid to run the tests on
different browsers and platforms. For this, you will need a selenium
server standalone jar which can be found in the given link—Selenium
Server Standalone Jar
Once you have downloaded the jar file, you need to set up the hub and
node based on the requirement. For the demonstration purpose, I will
create 1 hub and 2 nodes. 1 of the nodes will run firefox as browser-
related test cases. The other node will run chrome-related test cases.
Let’s start by creating a hub.
The command to create a node is as follows
java -jar selenium-server-standalone-3.141.59.jar -role hub
Below is the screenshot of the hub looks when it is up and running
Once you have created a hub and have obtained the hub register URL,
let’s register a node with chrome browser-related configurations. This
can be done in two ways,
1. By passing the arguments in the command line
2. By creating a JSON file with the required configurations.
I will be creating both nodes by passing the arguments from the
command line. The configuration goes as follows for creating a node
with chrome browser configuration
java -
Dwebdriver.chrome.driver=”/Users/macbook/Downloads/chromedriver” -
jar selenium-server-standalone-3.141.59.jar -role node -
hub http://localhost:4444/grid/register
Below is the screenshot of it looks when it is registered
Once you have registered that node, let’s register another node with
firefox browser configurations. The command to do so is as follows
java -
Dwebdriver.gecko.driver=”/Users/macbook/Downloads/geckodriver” -jar
selenium-server-standalone-3.141.59.jar -role node -
hub http://localhost:4444/grid/register
Below is the screenshot of it looks when it is registered
Once both the nodes are registered it can be verified by navigating to
the grid console. The same can also be verified on the hub console
Hub Console
Grid console URL is as follows—GRID Console
After you have registered both nodes, get the hub URL and append
wd/hub at the end. We will use this URL to route the test cases to
specific nodes as configured.
Hub Url—Hub URL
Now let's create a maven project and testng.xml file so that we can run
the tests parallelly.
Let’s add the selenium and testng dependency
The next step is to initialize the browser’s drivers based on the
requirement. chrome driver if chrome browser is required, firefox driver if
firefox browser is required.
Let’s write some basic test cases that are going to print the browser title
from both the browsers
Now let's run the test cases parallelly and see if the configurations
are working
Command to run the test—mvn clean test
Viola, one single test can now be run on 2 different browsers parallelly.
Refer to the console for execution results
For now, the platform in which I am running the test cases is MAC, this
can be changed when a different platform is configured like Windows,
Linux, etc. TestNG file to run the test cases parallelly is as below.
In the same way, safari and edge can also be configured to run the test
cases. It depends on the requirement of how many browsers and
platforms need to be covered.
That’s all folks, for now, see you guys in the next exciting blog.
Thank you !!

More Related Content

Similar to Cross Browser Testing using Selenium GRID.pdf (20)

PDF
Mobile Test Automation using one API and one infrastructure
Michael Palotas
 
PDF
The Selenium Grid: Run Multiple Automated Tests in Parallel
Josiah Renaudin
 
PPTX
SKILLWISE_SELENIUM
Skillwise Consulting
 
PPTX
Selenium – testing tool jack
Jackseen Jeyaluck
 
PPTX
Selenium WebDriver- Training Material and QA
Tahir Ali
 
PDF
Selenium grid workshop london 2016
Marcus Merrell
 
PPT
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
PPTX
Selenium 101 Webinar
Daniel Herken
 
PPTX
Intro
Vivek Rajasekar
 
PPTX
Selenium training
Suresh Arora
 
PDF
Introduction to Selenium grid
Knoldus Inc.
 
PPTX
Selenium
傑倫 鍾
 
PPTX
Selenium And Its Types
PriyanshuDutta2
 
PPTX
A Simple Guide to Selenium Software Testing
Calidad Infotech
 
PPTX
Selenium.pptx
orbitprojects
 
PDF
Cross-Browser Testing : A Complete Guide
Testgrid.io
 
PPTX
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
PPTX
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
PDF
Want to Control Your Computer? Learn Linux with Online Training!
manoharnaidunareshit
 
PDF
Selenium Automation Testing - A Complete Guide
Abhay Kumar
 
Mobile Test Automation using one API and one infrastructure
Michael Palotas
 
The Selenium Grid: Run Multiple Automated Tests in Parallel
Josiah Renaudin
 
SKILLWISE_SELENIUM
Skillwise Consulting
 
Selenium – testing tool jack
Jackseen Jeyaluck
 
Selenium WebDriver- Training Material and QA
Tahir Ali
 
Selenium grid workshop london 2016
Marcus Merrell
 
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
Selenium 101 Webinar
Daniel Herken
 
Selenium training
Suresh Arora
 
Introduction to Selenium grid
Knoldus Inc.
 
Selenium
傑倫 鍾
 
Selenium And Its Types
PriyanshuDutta2
 
A Simple Guide to Selenium Software Testing
Calidad Infotech
 
Selenium.pptx
orbitprojects
 
Cross-Browser Testing : A Complete Guide
Testgrid.io
 
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
Want to Control Your Computer? Learn Linux with Online Training!
manoharnaidunareshit
 
Selenium Automation Testing - A Complete Guide
Abhay Kumar
 

Recently uploaded (20)

PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Kubernetes - Architecture & Components.pdf
geethak285
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
Ad

Cross Browser Testing using Selenium GRID.pdf

  • 1. Cross Browser Testing using Selenium GRID Blogs Cross Browser Testing using Selenium GRID One of the challenges that we face while testing the application is testing it on different browsers and environments. We all might have observed that some websites are not properly displayed on some browsers and we just think that the website is broken. But, as soon as you open it on a different browser, the website opens up just fine. Thus, this behavior explains the compatibility of a website with different browsers.  Kiran HS, CoffeeBeans Each browser interprets the information on the website page differently, so, some browsers may lack the features that your website is trying to show and make your website look broken on that browser. That being the brief story, I bet you all have figured out the topic of today’s discussion—Cross Browser Testing. So what is cross browser testing? Cross browser testing is a type of testing that lets you check whether the websites are working as intended when accessed through
  • 2.  Different Browser—OS combination  Browsers like—Chrome, Firefox, Safari, Edge, etc  Operating Systems like—Windows, Linux, MAC, etc It’s about shipping releases that are as browser-agnostic as possible, which is key to delivering a uniform user experience on a diverse, ever- growing range of browsers/devices. As a tester, it is your responsibility to make sure that not only do applications work, but they work for all your users, no matter what browser, device, or additional assistive tools they are using. Now comes the next question - Why cross browser testing? 1. To check how the website appears on different browsers 2. To check how the website works on different browsers ( quite obvious ) 3. To ensure that you’re not alienating a significant part of your target audience–simply because your website does not work on their browser OS. The next question which comes to mind is - How to perform cross browser testing? This can be done in two (obvious) ways 1. Manual Approach (Manually check the functionality on different browsers and platforms, painful process to follow) 2. Automation Approach (Write one piece of code and run it on different browsers and platform combinations—sounds cool and easy right?) That being said, let’s dive into the automation approach and see how this can be achieved with Selenium, Selenium GRID, and TestNG
  • 3. Firstly, you will need to set up a selenium grid to run the tests on different browsers and platforms. For this, you will need a selenium server standalone jar which can be found in the given link—Selenium Server Standalone Jar Once you have downloaded the jar file, you need to set up the hub and node based on the requirement. For the demonstration purpose, I will create 1 hub and 2 nodes. 1 of the nodes will run firefox as browser- related test cases. The other node will run chrome-related test cases. Let’s start by creating a hub. The command to create a node is as follows java -jar selenium-server-standalone-3.141.59.jar -role hub Below is the screenshot of the hub looks when it is up and running Once you have created a hub and have obtained the hub register URL, let’s register a node with chrome browser-related configurations. This can be done in two ways,
  • 4. 1. By passing the arguments in the command line 2. By creating a JSON file with the required configurations. I will be creating both nodes by passing the arguments from the command line. The configuration goes as follows for creating a node with chrome browser configuration java - Dwebdriver.chrome.driver=”/Users/macbook/Downloads/chromedriver” - jar selenium-server-standalone-3.141.59.jar -role node - hub http://localhost:4444/grid/register Below is the screenshot of it looks when it is registered Once you have registered that node, let’s register another node with firefox browser configurations. The command to do so is as follows java - Dwebdriver.gecko.driver=”/Users/macbook/Downloads/geckodriver” -jar selenium-server-standalone-3.141.59.jar -role node - hub http://localhost:4444/grid/register
  • 5. Below is the screenshot of it looks when it is registered Once both the nodes are registered it can be verified by navigating to the grid console. The same can also be verified on the hub console Hub Console
  • 6. Grid console URL is as follows—GRID Console After you have registered both nodes, get the hub URL and append wd/hub at the end. We will use this URL to route the test cases to specific nodes as configured. Hub Url—Hub URL Now let's create a maven project and testng.xml file so that we can run the tests parallelly. Let’s add the selenium and testng dependency
  • 7. The next step is to initialize the browser’s drivers based on the requirement. chrome driver if chrome browser is required, firefox driver if firefox browser is required. Let’s write some basic test cases that are going to print the browser title from both the browsers
  • 8. Now let's run the test cases parallelly and see if the configurations are working Command to run the test—mvn clean test
  • 9. Viola, one single test can now be run on 2 different browsers parallelly. Refer to the console for execution results For now, the platform in which I am running the test cases is MAC, this can be changed when a different platform is configured like Windows, Linux, etc. TestNG file to run the test cases parallelly is as below.
  • 10. In the same way, safari and edge can also be configured to run the test cases. It depends on the requirement of how many browsers and platforms need to be covered. That’s all folks, for now, see you guys in the next exciting blog. Thank you !!