SlideShare a Scribd company logo
1
Automated Testing
With Selenium
1
2
Agenda
1. Architecture of Selenium
2. Introduction to IDE, WebDriver and
Selenium Grid
3. Different Locator Technique
4. Invoke Different Browsers and logic behind
browsers
5. TestNG
6. Automate a LoginPage
7. QnA
2
Architecture of Selenium
3
JSON Wire Protocol
over HTTP
JSON Wire Protocol
over HTTP BrowserBrowser
Driver APIDriver API
C#C#
RubyRubyRubyRuby
JavaJava
PythonPython
Language Binding
OR
Selenium Client Library Real BrowsersReal Browsers
http request over
HTTP Server
http response to
HTTP Server
Selenium Server
IDE, WebDriver and Grid
Selenium IDE
• Selenium IDE is an integrated development environment for Selenium scripts. It is implemented
as a Chrome and Firefox extension, and allows you to record, edit, and debug tests.
• This is basically record and play
• Recorded script can be exported in different languages.
• This extension is available for Chrome and Mozilla
4
SeleniumWebDriver
• WebDriver is one of the most powerful and popular tools of Selenium Family.
• WebDriver extends its support to many latest browsers and platforms
• WebDriver makes direct calls to the Web browser and the entire test script is executed in this
fashion. WebDriver uses the browsers support and capabilities to automation.
• It drives the browser much more effectively
Selenium Grid
• Selenium Grid is a part of the Selenium Suite that enable in running multiple tests across different
browsers, in different OS and in different Machines.
• This will assures us that the application is fully compatible to different browsers running on
different OS
• It reduces the time to test application on diversified environment.
5
IDE, WebDriver and Grid cont..
Setup the Environment in Eclipse
• Download Selenium server from selenium official portal seleniumhq.org
• Download selenium language binding (Java we will be using here)
• Download Chrome Browser executable file (https://chromedriver.storage.googleapis.com/index.html?path=2.41/)
• Start Eclipse and Create a Java Project.
• Add the downloaded JAR to this project (Selenium Server Jar and Java language jar)
6
Launch the browser
public class LaunchBrowsers {
public WebDriver driver;
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", “C:chromedriver.exe");
ChromeDriver driver = new ChromeDriver();
driver.get("https://google.com");
7
Program and logics behind it
public class LaunchBrowsers {
public WebDriver driver;
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", “C:chromedriver.exe");
ChromeDriver driver = new ChromeDriver();
driver.get("https://google.com");
Let’s understand the Browser behavior and the logic behind it.
TestNG
• TestNG is a testing framework
• This is an open source testing framework, TestNG has NG, which means Next Generation
• TestNG is derived after JUnit and it is much more powerful than JUnit
• TestNG enables us to write Business logic, Step by Step test, write information about Test,
Prioirtize the Testing Methods and Testing functionalities.
• There are many annotations used on TestNG like - @BeforeTest, @AfterTest, @BeforeClass,
@Test
Install TestNG in Eclipse
• Eclipse >> Help >> install New Software >> Name: TestNG” and type “http://beust.com/eclipse/”
as location.
8
TestNG : How it works
• Selenium works on Web automation through action performed on Web Component –
which is called as “Locators”
• We use these locators in our test script and while execution selenium server performs
action on these locators – which is called as “Web Elements”
• In Selenium there are 8 ways to locate these element
1.By xpath
2.By ID
3.By Name
4.By Link Text
5.By Partial Link Text
6.By Class Name
7.By CSS
8.By Tag Name
9
Locator Technique in Selenium
Demo and Practical on Locators on Real Website
Let’s launch the demo portal and locate the elements:
10
11
12

More Related Content

What's hot

Automated UI testing with Selenium
Automated UI testing with SeleniumAutomated UI testing with Selenium
Automated UI testing with Selenium
Yuriy Gerasimov
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
Brian Jordan
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
usha kannappan
 
BDD using Cucumber JVM
BDD using Cucumber JVMBDD using Cucumber JVM
BDD using Cucumber JVM
Vijay Krishnan Ramaswamy
 
Selenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set UpSelenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set Up
ITProfessional Academy
 
Get Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridGet Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 Grid
Daniel Herken
 
Selenium Topic 2 IDE
Selenium Topic 2 IDESelenium Topic 2 IDE
Selenium Topic 2 IDE
ITProfessional Academy
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
Nick Belhomme
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
Marakana Inc.
 
Introduction to Eclipse IDE
Introduction to Eclipse IDEIntroduction to Eclipse IDE
Introduction to Eclipse IDE
Muhammad Hafiz Hasan
 
Selenium Webdriver
Selenium WebdriverSelenium Webdriver
Selenium Webdriver
Muhammad Bilal
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
Clever Moe
 
Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
Anuradha Malalasena
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Atirek Gupta
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
eleksdev
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
Agile Testing Alliance
 
Introduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeopleIntroduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeople
SpringPeople
 
Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)
AOE
 
Smarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automationSmarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automation
RIA RUI Society
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
Max Klymyshyn
 

What's hot (20)

Automated UI testing with Selenium
Automated UI testing with SeleniumAutomated UI testing with Selenium
Automated UI testing with Selenium
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
BDD using Cucumber JVM
BDD using Cucumber JVMBDD using Cucumber JVM
BDD using Cucumber JVM
 
Selenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set UpSelenium topic 4 - Selenium Web Driver Set Up
Selenium topic 4 - Selenium Web Driver Set Up
 
Get Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridGet Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 Grid
 
Selenium Topic 2 IDE
Selenium Topic 2 IDESelenium Topic 2 IDE
Selenium Topic 2 IDE
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance tests
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
Introduction to Eclipse IDE
Introduction to Eclipse IDEIntroduction to Eclipse IDE
Introduction to Eclipse IDE
 
Selenium Webdriver
Selenium WebdriverSelenium Webdriver
Selenium Webdriver
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Selenium Automation
Selenium AutomationSelenium Automation
Selenium Automation
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
 
#2 integration + ui tests
#2 integration + ui tests#2 integration + ui tests
#2 integration + ui tests
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Introduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeopleIntroduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeople
 
Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)Selenium 2 for PHP(Unit)
Selenium 2 for PHP(Unit)
 
Smarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automationSmarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automation
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
 

Similar to Selenium Java for Beginners by Sujit Pathak

Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
shivani thakur
 
Selenium for Tester.pdf
Selenium for Tester.pdfSelenium for Tester.pdf
Selenium for Tester.pdf
RTechRInfoIT
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
orbitprojects
 
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-JupiterToolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Boni García
 
Selenium 101 Webinar
Selenium 101 WebinarSelenium 101 Webinar
Selenium 101 Webinar
Daniel Herken
 
seldmskksnnisjals, sjnsjjs dsajdjsadsdjsnsjn.pptx
seldmskksnnisjals, sjnsjjs  dsajdjsadsdjsnsjn.pptxseldmskksnnisjals, sjnsjjs  dsajdjsadsdjsnsjn.pptx
seldmskksnnisjals, sjnsjjs dsajdjsadsdjsnsjn.pptx
hihello401384
 
Intro
IntroIntro
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
Nikhil Kapoor
 
Session 01 - Introduction to Selenium - Part 2
Session 01 - Introduction to Selenium - Part 2Session 01 - Introduction to Selenium - Part 2
Session 01 - Introduction to Selenium - Part 2
SiddharthSelenium
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
Pandiya Rajan
 
Selenium Introduction and IDE
Selenium Introduction and IDESelenium Introduction and IDE
Selenium Introduction and IDE
Murageppa-QA
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
Slobodan Lohja
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
Roman Savitskiy
 
Mobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructureMobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructure
Michael Palotas
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
Sauce Labs
 
Selenium RC Overview
Selenium RC OverviewSelenium RC Overview
Selenium RC Overview
Ganesh Mandala
 
Selenium
SeleniumSelenium
Selenium
Anjali Rao
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
Sachin-QA
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
ANKUR-BA
 

Similar to Selenium Java for Beginners by Sujit Pathak (20)

Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
Selenium for Tester.pdf
Selenium for Tester.pdfSelenium for Tester.pdf
Selenium for Tester.pdf
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-JupiterToolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
Toolbox for Selenium Tests in Java: WebDriverManager and Selenium-Jupiter
 
Selenium 101 Webinar
Selenium 101 WebinarSelenium 101 Webinar
Selenium 101 Webinar
 
seldmskksnnisjals, sjnsjjs dsajdjsadsdjsnsjn.pptx
seldmskksnnisjals, sjnsjjs  dsajdjsadsdjsnsjn.pptxseldmskksnnisjals, sjnsjjs  dsajdjsadsdjsnsjn.pptx
seldmskksnnisjals, sjnsjjs dsajdjsadsdjsnsjn.pptx
 
Intro
IntroIntro
Intro
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
 
Session 01 - Introduction to Selenium - Part 2
Session 01 - Introduction to Selenium - Part 2Session 01 - Introduction to Selenium - Part 2
Session 01 - Introduction to Selenium - Part 2
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Selenium Introduction and IDE
Selenium Introduction and IDESelenium Introduction and IDE
Selenium Introduction and IDE
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Mobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructureMobile Test Automation using one API and one infrastructure
Mobile Test Automation using one API and one infrastructure
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
 
Selenium RC Overview
Selenium RC OverviewSelenium RC Overview
Selenium RC Overview
 
Selenium
SeleniumSelenium
Selenium
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 

More from Software Testing Board

Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018
Software Testing Board
 
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Software Testing Board
 
Introduction to Selenium Python by Kishore
Introduction to Selenium Python by KishoreIntroduction to Selenium Python by Kishore
Introduction to Selenium Python by Kishore
Software Testing Board
 
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Software Testing Board
 
BRD document for test automation estimation
BRD document for test automation estimationBRD document for test automation estimation
BRD document for test automation estimation
Software Testing Board
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit Jain
Software Testing Board
 
Docker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai VigneshDocker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai Vignesh
Software Testing Board
 
A testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen SultanaA testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen Sultana
Software Testing Board
 
Shift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun DuttaShift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun Dutta
Software Testing Board
 
Software Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer siteSoftware Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer site
Software Testing Board
 
Agile Testing by ShriKant Vashishtha
Agile Testing by ShriKant VashishthaAgile Testing by ShriKant Vashishtha
Agile Testing by ShriKant Vashishtha
Software Testing Board
 

More from Software Testing Board (11)

Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018Software Testing Board meetup 24th-Nov-2018
Software Testing Board meetup 24th-Nov-2018
 
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
Manage Selenium Grid with Terraform by Omkar Khatavkar (https://www.linkedin....
 
Introduction to Selenium Python by Kishore
Introduction to Selenium Python by KishoreIntroduction to Selenium Python by Kishore
Introduction to Selenium Python by Kishore
 
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi Shell scripting to test volume of SEO pages with ease by Abdul Hadi
Shell scripting to test volume of SEO pages with ease by Abdul Hadi
 
BRD document for test automation estimation
BRD document for test automation estimationBRD document for test automation estimation
BRD document for test automation estimation
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit Jain
 
Docker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai VigneshDocker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai Vignesh
 
A testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen SultanaA testers survival guide for agile transition by Parveen Sultana
A testers survival guide for agile transition by Parveen Sultana
 
Shift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun DuttaShift left shift-right performance testing for superior end-user by Arun Dutta
Shift left shift-right performance testing for superior end-user by Arun Dutta
 
Software Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer siteSoftware Testing Board's start-here guide for the Question and Answer site
Software Testing Board's start-here guide for the Question and Answer site
 
Agile Testing by ShriKant Vashishtha
Agile Testing by ShriKant VashishthaAgile Testing by ShriKant Vashishtha
Agile Testing by ShriKant Vashishtha
 

Recently uploaded

BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 

Recently uploaded (20)

BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 

Selenium Java for Beginners by Sujit Pathak

  • 2. 2 Agenda 1. Architecture of Selenium 2. Introduction to IDE, WebDriver and Selenium Grid 3. Different Locator Technique 4. Invoke Different Browsers and logic behind browsers 5. TestNG 6. Automate a LoginPage 7. QnA 2
  • 3. Architecture of Selenium 3 JSON Wire Protocol over HTTP JSON Wire Protocol over HTTP BrowserBrowser Driver APIDriver API C#C# RubyRubyRubyRuby JavaJava PythonPython Language Binding OR Selenium Client Library Real BrowsersReal Browsers http request over HTTP Server http response to HTTP Server Selenium Server
  • 4. IDE, WebDriver and Grid Selenium IDE • Selenium IDE is an integrated development environment for Selenium scripts. It is implemented as a Chrome and Firefox extension, and allows you to record, edit, and debug tests. • This is basically record and play • Recorded script can be exported in different languages. • This extension is available for Chrome and Mozilla 4
  • 5. SeleniumWebDriver • WebDriver is one of the most powerful and popular tools of Selenium Family. • WebDriver extends its support to many latest browsers and platforms • WebDriver makes direct calls to the Web browser and the entire test script is executed in this fashion. WebDriver uses the browsers support and capabilities to automation. • It drives the browser much more effectively Selenium Grid • Selenium Grid is a part of the Selenium Suite that enable in running multiple tests across different browsers, in different OS and in different Machines. • This will assures us that the application is fully compatible to different browsers running on different OS • It reduces the time to test application on diversified environment. 5 IDE, WebDriver and Grid cont..
  • 6. Setup the Environment in Eclipse • Download Selenium server from selenium official portal seleniumhq.org • Download selenium language binding (Java we will be using here) • Download Chrome Browser executable file (https://chromedriver.storage.googleapis.com/index.html?path=2.41/) • Start Eclipse and Create a Java Project. • Add the downloaded JAR to this project (Selenium Server Jar and Java language jar) 6 Launch the browser public class LaunchBrowsers { public WebDriver driver; public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", “C:chromedriver.exe"); ChromeDriver driver = new ChromeDriver(); driver.get("https://google.com");
  • 7. 7 Program and logics behind it public class LaunchBrowsers { public WebDriver driver; public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", “C:chromedriver.exe"); ChromeDriver driver = new ChromeDriver(); driver.get("https://google.com"); Let’s understand the Browser behavior and the logic behind it.
  • 8. TestNG • TestNG is a testing framework • This is an open source testing framework, TestNG has NG, which means Next Generation • TestNG is derived after JUnit and it is much more powerful than JUnit • TestNG enables us to write Business logic, Step by Step test, write information about Test, Prioirtize the Testing Methods and Testing functionalities. • There are many annotations used on TestNG like - @BeforeTest, @AfterTest, @BeforeClass, @Test Install TestNG in Eclipse • Eclipse >> Help >> install New Software >> Name: TestNG” and type “http://beust.com/eclipse/” as location. 8 TestNG : How it works
  • 9. • Selenium works on Web automation through action performed on Web Component – which is called as “Locators” • We use these locators in our test script and while execution selenium server performs action on these locators – which is called as “Web Elements” • In Selenium there are 8 ways to locate these element 1.By xpath 2.By ID 3.By Name 4.By Link Text 5.By Partial Link Text 6.By Class Name 7.By CSS 8.By Tag Name 9 Locator Technique in Selenium
  • 10. Demo and Practical on Locators on Real Website Let’s launch the demo portal and locate the elements: 10
  • 11. 11
  • 12. 12

Editor's Notes

  1. Who we are Testing JS code and front-end Listing the types of tests Looking at some test tools Writing and running tests Testing without the browser What is a headless browser Scripting with a headless browser Testing with a headless browser Continuous Integration Deploying code Integrating testing with builds Review build results