SlideShare ist ein Scribd-Unternehmen logo
1 von 12
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

Weitere ähnliche Inhalte

Was ist angesagt?

Automated UI testing with Selenium
Automated UI testing with SeleniumAutomated UI testing with Selenium
Automated UI testing with SeleniumYuriy 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 CurriculumBrian 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 Controlusha kannappan
 
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 UpITProfessional 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 GridDaniel Herken
 
Mastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsMastering selenium for automated acceptance tests
Mastering selenium for automated acceptance testsNick Belhomme
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With SeleniumMarakana Inc.
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics TutorialClever Moe
 
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 testseleksdev
 
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 GundechaAgile Testing Alliance
 
Introduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeopleIntroduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeopleSpringPeople
 
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, automationRIA 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 DeploymentMax Klymyshyn
 

Was ist angesagt? (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
 

Ähnlich wie Selenium Java for Beginners by Sujit Pathak

Selenium for Tester.pdf
Selenium for Tester.pdfSelenium for Tester.pdf
Selenium for Tester.pdfRTechRInfoIT
 
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-JupiterBoni García
 
Selenium 101 Webinar
Selenium 101 WebinarSelenium 101 Webinar
Selenium 101 WebinarDaniel Herken
 
seldmskksnnisjals, sjnsjjs dsajdjsadsdjsnsjn.pptx
seldmskksnnisjals, sjnsjjs  dsajdjsadsdjsnsjn.pptxseldmskksnnisjals, sjnsjjs  dsajdjsadsdjsnsjn.pptx
seldmskksnnisjals, sjnsjjs dsajdjsadsdjsnsjn.pptxhihello401384
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using SeleniumNikhil 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 2SiddharthSelenium
 
Selenium Introduction and IDE
Selenium Introduction and IDESelenium Introduction and IDE
Selenium Introduction and IDEMurageppa-QA
 
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 infrastructureMichael 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 ScaleSauce Labs
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionSachin-QA
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - IntroductionANKUR-BA
 

Ähnlich wie 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
 

Mehr von 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-2018Software 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 KishoreSoftware 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 estimationSoftware Testing Board
 
Micro Service automation by Srijit Jain
Micro Service automation by Srijit JainMicro Service automation by Srijit Jain
Micro Service automation by Srijit JainSoftware Testing Board
 
Docker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai VigneshDocker with Selenium by Thirumalai Vignesh
Docker with Selenium by Thirumalai VigneshSoftware 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 SultanaSoftware 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 DuttaSoftware 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 siteSoftware Testing Board
 

Mehr von 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
 

Kürzlich hochgeladen

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 

Kürzlich hochgeladen (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 

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

Hinweis der Redaktion

  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