SlideShare a Scribd company logo
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.
 By 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.
To know more visit our remaining pages:-
Website:- https://coffeebeans.io/
Blogs:- https://coffeebeans.io/blogs

More Related Content

Similar to Cross Browser Testing using Selenium GRID (20)

PPT
Running Selenium tests on CI server
Aleksandr Zhuikov
 
PPT
Selenium Java for Beginners by Sujit Pathak
Software Testing Board
 
PPTX
Selenium practical
Ruslan Strazhnyk
 
PDF
The Selenium Grid: Run Multiple Automated Tests in Parallel
Josiah Renaudin
 
PDF
Cross-Browser Testing : A Complete Guide
Testgrid.io
 
PPTX
Type Cross browsers testing
Nguyễn Đào Thiên Thư
 
PDF
Selenium Automation Testing - A Complete Guide
Abhay Kumar
 
PPT
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
PPTX
Selenium
Mayuresh Wadekar
 
PDF
Selenium grid workshop london 2016
Marcus Merrell
 
PPTX
SKILLWISE_SELENIUM
Skillwise Consulting
 
PDF
Selenium Testing The Complete Step-by-Step Tutorial.pdf
Steve Wortham
 
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
Executing Parallel Test Sessions with TestNG and Selenium WebDriver
pCloudy
 
PPTX
Selenium
傑倫 鍾
 
PPTX
A Simple Guide to Selenium Software Testing
Calidad Infotech
 
PPTX
Selenium training
Suresh Arora
 
PPTX
Selenium 101 Webinar
Daniel Herken
 
Running Selenium tests on CI server
Aleksandr Zhuikov
 
Selenium Java for Beginners by Sujit Pathak
Software Testing Board
 
Selenium practical
Ruslan Strazhnyk
 
The Selenium Grid: Run Multiple Automated Tests in Parallel
Josiah Renaudin
 
Cross-Browser Testing : A Complete Guide
Testgrid.io
 
Type Cross browsers testing
Nguyễn Đào Thiên Thư
 
Selenium Automation Testing - A Complete Guide
Abhay Kumar
 
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
Selenium grid workshop london 2016
Marcus Merrell
 
SKILLWISE_SELENIUM
Skillwise Consulting
 
Selenium Testing The Complete Step-by-Step Tutorial.pdf
Steve Wortham
 
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
Want to Control Your Computer? Learn Linux with Online Training!
manoharnaidunareshit
 
Executing Parallel Test Sessions with TestNG and Selenium WebDriver
pCloudy
 
Selenium
傑倫 鍾
 
A Simple Guide to Selenium Software Testing
Calidad Infotech
 
Selenium training
Suresh Arora
 
Selenium 101 Webinar
Daniel Herken
 

Recently uploaded (20)

PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PDF
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
Next level data operations using Power Automate magic
Andries den Haan
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Understanding AI Optimization AIO, LLMO, and GEO
CoDigital
 
Ad

Cross Browser Testing using Selenium GRID

  • 1. 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.  By 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
  • 2. 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.
  • 3. 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
  • 4. 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
  • 5. 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.
  • 8. 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
  • 9. 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.
  • 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. To know more visit our remaining pages:- Website:- https://coffeebeans.io/ Blogs:- https://coffeebeans.io/blogs