SlideShare a Scribd company logo
1 of 10
Download to read offline
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

anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdfanoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdfSunilNagaraj10
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriverAnuraj S.L
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersHaitham Refaat
 
Selenium for Tester.pdf
Selenium for Tester.pdfSelenium for Tester.pdf
Selenium for Tester.pdfRTechRInfoIT
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverPankaj Biswas
 
Web topic 26 browser compatibilty and security
Web topic 26  browser compatibilty and securityWeb topic 26  browser compatibilty and security
Web topic 26 browser compatibilty and securityCK Yang
 
"Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R...
"Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R..."Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R...
"Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R...Fwdays
 
How to do better Quality Assurance for Cross-Browser Testing
How to do better Quality Assurance for Cross-Browser TestingHow to do better Quality Assurance for Cross-Browser Testing
How to do better Quality Assurance for Cross-Browser TestingBOSS Webtech
 
Scalable and Reliable Cross Browser Testing With Cypress Framework
Scalable and Reliable Cross Browser Testing With Cypress FrameworkScalable and Reliable Cross Browser Testing With Cypress Framework
Scalable and Reliable Cross Browser Testing With Cypress FrameworkKnoldus Inc.
 
Selenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser TestingSelenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser TestingSarah Elson
 
Python selenium
Python seleniumPython selenium
Python seleniumDucat
 
How to work with Selenium Grid and Cloud Solutions
How to work with Selenium Grid and Cloud SolutionsHow to work with Selenium Grid and Cloud Solutions
How to work with Selenium Grid and Cloud SolutionsNoam Zakai
 
Web application penetration testing lab setup guide
Web application penetration testing lab setup guideWeb application penetration testing lab setup guide
Web application penetration testing lab setup guideSudhanshu Chauhan
 
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptxA Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptxMatthew Allen
 

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

anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdfanoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
 
Protractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine ReportersProtractor Testing Automation Tool Framework / Jasmine Reporters
Protractor Testing Automation Tool Framework / Jasmine Reporters
 
Selenium for Tester.pdf
Selenium for Tester.pdfSelenium for Tester.pdf
Selenium for Tester.pdf
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 
Selenium
SeleniumSelenium
Selenium
 
Web topic 26 browser compatibilty and security
Web topic 26  browser compatibilty and securityWeb topic 26  browser compatibilty and security
Web topic 26 browser compatibilty and security
 
VorlonJS
VorlonJSVorlonJS
VorlonJS
 
"Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R...
"Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R..."Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R...
"Hidden difficulties of debugger implementation for .NET WASM apps", Andrii R...
 
How to do better Quality Assurance for Cross-Browser Testing
How to do better Quality Assurance for Cross-Browser TestingHow to do better Quality Assurance for Cross-Browser Testing
How to do better Quality Assurance for Cross-Browser Testing
 
Scalable and Reliable Cross Browser Testing With Cypress Framework
Scalable and Reliable Cross Browser Testing With Cypress FrameworkScalable and Reliable Cross Browser Testing With Cypress Framework
Scalable and Reliable Cross Browser Testing With Cypress Framework
 
Qa process
Qa processQa process
Qa process
 
Qa process
Qa processQa process
Qa process
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Selenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser TestingSelenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser Testing
 
Python selenium
Python seleniumPython selenium
Python selenium
 
How to work with Selenium Grid and Cloud Solutions
How to work with Selenium Grid and Cloud SolutionsHow to work with Selenium Grid and Cloud Solutions
How to work with Selenium Grid and Cloud Solutions
 
Web application penetration testing lab setup guide
Web application penetration testing lab setup guideWeb application penetration testing lab setup guide
Web application penetration testing lab setup guide
 
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptxA Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
 
Sel
SelSel
Sel
 

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

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 !!