SlideShare a Scribd company logo
Selenium WebDriver
By
Arti Tripathi & Amit Agarwal
Agenda
• What is Selenium Grid?
• What is Selenium Hub and Node?
• Setting up Selenium Grid 2 using multiple VMs.
– Configuring Grid 2 using webconfig.txt JSON format
configuration file.
– Running Grid 2 console in browser.
– Update setup method of BaseTestSetup.java file.
– Update TestNG.xml file.
• Run test scripts on multiple VMs using Grid 2.
What is Selenium Grid?
• Selenium-Grid allows you run your tests on
different machines against different browsers
in parallel. That is, running multiple tests at
the same time against different machines
running different browsers and operating
systems. Essentially, Selenium-Grid support
distributed test execution. It allows for
running your tests in a distributed test
execution environment.
What is Selenium Hub and Node?
• Hub – Implies selenium grid 2 hub which
distributes tests among multiple nodes
registered to it at runtime.
• Node – One node represents one machine
where test will be running & we can have
multiple nodes those will be registered with
one centralized hub which will be running on
anyone machine.
Setting up Selenium Grid 2 using
multiple VMs.
• Download latest version of selenium-server-
standalone-x.x.x.jar.
• Create JSON configuration file.
• Copying both ‘selenium-server-standalone-
x.x.x.jar’ and ‘webconfig.txt’ on number of
machines/VMs required for testing.
• Run Hub and Nodes.
Configuring Grid 2 using webconfig.txt
JSON format configuration file.
• browsersName & maxInstances
• port
• host
• hubPort
• hubHost
Running Grid 2 console in browser.
• Open the browser, Enter the following URL:-
http://put_hub_machine_name:4444/grid/co
nsole
(Note: - Don’t forget to enter the
“hub_machine_name” in above URL)
Update setup method of BaseTestSetup.java file
Update TestNG.xml file.
Run test scripts on multiple VMs
using Grid 2
Queries and Parking lot
Thank You

More Related Content

Similar to Selenium WebDriver- Training Material and QA

Selenium Automation Using Ruby
Selenium Automation Using RubySelenium Automation Using Ruby
Selenium Automation Using Ruby
Kumari Warsha Goel
 
Running Selenium tests on CI server
Running Selenium tests on CI serverRunning Selenium tests on CI server
Running Selenium tests on CI server
Aleksandr Zhuikov
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
Maarten Smeets
 

Similar to Selenium WebDriver- Training Material and QA (20)

Selenium Introduction
Selenium IntroductionSelenium Introduction
Selenium Introduction
 
Yevhenii Ovcharenko "Distributed automation testing using Minikube, Selenium ...
Yevhenii Ovcharenko "Distributed automation testing using Minikube, Selenium ...Yevhenii Ovcharenko "Distributed automation testing using Minikube, Selenium ...
Yevhenii Ovcharenko "Distributed automation testing using Minikube, Selenium ...
 
SKILLWISE_SELENIUM
SKILLWISE_SELENIUMSKILLWISE_SELENIUM
SKILLWISE_SELENIUM
 
Easy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium DockerEasy Setup for Parallel Test Execution with Selenium Docker
Easy Setup for Parallel Test Execution with Selenium Docker
 
Selenium
SeleniumSelenium
Selenium
 
Selenium Automation Using Ruby
Selenium Automation Using RubySelenium Automation Using Ruby
Selenium Automation Using Ruby
 
QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
 
Kubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platformKubernetes your tests! automation with docker on google cloud platform
Kubernetes your tests! automation with docker on google cloud platform
 
Running Selenium tests on CI server
Running Selenium tests on CI serverRunning Selenium tests on CI server
Running Selenium tests on CI server
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
 
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
Getting Started with Dockerization of Selenium Tests Execution - Testwarez 2019
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Run Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAllRun Selenium Tests With Jenkins and BrowseEmAll
Run Selenium Tests With Jenkins and BrowseEmAll
 
First steps with selenium rc
First steps with selenium rcFirst steps with selenium rc
First steps with selenium rc
 
Automated Testing on Web Applications
Automated Testing on Web ApplicationsAutomated Testing on Web Applications
Automated Testing on Web Applications
 
Performance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMsPerformance of Microservice Frameworks on different JVMs
Performance of Microservice Frameworks on different JVMs
 
Run UI Automation Tests using Selenium Grid and Azure Container Service (AKS)
Run UI Automation Tests using Selenium Grid and Azure Container Service (AKS)Run UI Automation Tests using Selenium Grid and Azure Container Service (AKS)
Run UI Automation Tests using Selenium Grid and Azure Container Service (AKS)
 
How to use_cucumber_rest-assured_api_framework
How to use_cucumber_rest-assured_api_frameworkHow to use_cucumber_rest-assured_api_framework
How to use_cucumber_rest-assured_api_framework
 
Kubernetes acomprehensiveoverview
Kubernetes acomprehensiveoverviewKubernetes acomprehensiveoverview
Kubernetes acomprehensiveoverview
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 

Recently uploaded

The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
heathfieldcps1
 
Neurulation and the formation of the neural tube
Neurulation and the formation of the neural tubeNeurulation and the formation of the neural tube
Neurulation and the formation of the neural tube
SaadHumayun7
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyes
ashishpaul799
 

Recently uploaded (20)

....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
Word Stress rules esl .pptx
Word Stress rules esl               .pptxWord Stress rules esl               .pptx
Word Stress rules esl .pptx
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17Features of Video Calls in the Discuss Module in Odoo 17
Features of Video Calls in the Discuss Module in Odoo 17
 
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdf
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdfPost Exam Fun(da) Intra UEM General Quiz - Finals.pdf
Post Exam Fun(da) Intra UEM General Quiz - Finals.pdf
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
Neurulation and the formation of the neural tube
Neurulation and the formation of the neural tubeNeurulation and the formation of the neural tube
Neurulation and the formation of the neural tube
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
ppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyesppt your views.ppt your views of your college in your eyes
ppt your views.ppt your views of your college in your eyes
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdfPost Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
Post Exam Fun(da) Intra UEM General Quiz 2024 - Prelims q&a.pdf
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 

Selenium WebDriver- Training Material and QA

  • 2. Agenda • What is Selenium Grid? • What is Selenium Hub and Node? • Setting up Selenium Grid 2 using multiple VMs. – Configuring Grid 2 using webconfig.txt JSON format configuration file. – Running Grid 2 console in browser. – Update setup method of BaseTestSetup.java file. – Update TestNG.xml file. • Run test scripts on multiple VMs using Grid 2.
  • 3. What is Selenium Grid? • Selenium-Grid allows you run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems. Essentially, Selenium-Grid support distributed test execution. It allows for running your tests in a distributed test execution environment.
  • 4. What is Selenium Hub and Node? • Hub – Implies selenium grid 2 hub which distributes tests among multiple nodes registered to it at runtime. • Node – One node represents one machine where test will be running & we can have multiple nodes those will be registered with one centralized hub which will be running on anyone machine.
  • 5. Setting up Selenium Grid 2 using multiple VMs. • Download latest version of selenium-server- standalone-x.x.x.jar. • Create JSON configuration file. • Copying both ‘selenium-server-standalone- x.x.x.jar’ and ‘webconfig.txt’ on number of machines/VMs required for testing. • Run Hub and Nodes.
  • 6. Configuring Grid 2 using webconfig.txt JSON format configuration file. • browsersName & maxInstances • port • host • hubPort • hubHost
  • 7. Running Grid 2 console in browser. • Open the browser, Enter the following URL:- http://put_hub_machine_name:4444/grid/co nsole (Note: - Don’t forget to enter the “hub_machine_name” in above URL)
  • 8. Update setup method of BaseTestSetup.java file
  • 10. Run test scripts on multiple VMs using Grid 2

Editor's Notes

  1. Sample webconfig.txt:- { "capabilities": [ { "browserName": "firefox", "acceptSslCerts": true, "javascriptEnabled": true, "takeScreenshots": true, "firefox_profile": "", "maxInstances": 3, "seleniumProtocol": "WebDriver" }, { "browserName": "chrome", "maxInstances": 3, "seleniumProtocol": "WebDriver" }, { "platform": "WINDOWS", "browserName": "internet explorer", "maxInstances": 4, "seleniumProtocol": "WebDriver" } ], "configuration": { "cleanUpCycle": 2000, "timeout": 30000, "proxy": "org.openqa.grid.selenium.proxy.WebDriverRemoteProxy", "maxSession": 5, "port": 5555, "host": noiam003ag-w1, "register": true, "hubPort": 4444, "hubHost" : noiam003ag-w1 } }
  2. BaseTestSetup.java :- public WebDriver setup(String BROWSER) throws MalformedURLException{ System.out.println("Browser: " + BROWSER); if (BROWSER.equals("FF")) { System.out.println("FF is selected"); capability = DesiredCapabilities.firefox(); capability.setBrowserName("firefox"); capability.setPlatform(org.openqa.selenium.Platform.ANY); driver = new RemoteWebDriver(new URL("http://noiam003ag-w1:4444/wd/hub"), capability); driver.get(baseURL); } else if (BROWSER.equals("IE")) { System.out.println("IE is selected"); capability = DesiredCapabilities.internetExplorer(); capability.setBrowserName("internet explorer"); capability.setPlatform(org.openqa.selenium.Platform.WINDOWS); } else if (BROWSER.equals("CH")){ System.out.println("Google chrome is selected"); System.setProperty("webdriver.chrome.driver", "C:/ChromeDriver/chromedriver.exe"); capability = DesiredCapabilities.chrome(); capability.setBrowserName("chrome"); capability.setPlatform(org.openqa.selenium.Platform.WINDOWS); driver = new RemoteWebDriver(new URL("http://noiam003ag-w1:4444/wd/hub"), capability); driver.get(baseURL); } System.out.println("Remote Driver setup"); return driver; }