SlideShare a Scribd company logo
Quality Assurance /
Software Testing Training
Page 2Classification: Restricted
Agenda
• Overview of Selenium WebDriver
• Get Selenium WebDriver Java
• Selenium – JAVA Configuration
• WebDriver in Different Browsers
• Open Application
• Browser Settings
• Locating Elements
• Object Identification Methods
• Locator ID, Name
• Locators –LinkText, partialLinkText, CSS, CSS
• Accessing different objects in application
• Switch Window
• Wait in WebDriver
• Verifications
• WebTable
Page 3Classification: Restricted
• Selenium WebDriver - is latest version of Selenium (Selenium 2/3)
• WebDriver is a compact Object Oriented API when compared to
Selenium1.0
• It drives the browser much more effectively
• WebDriver will support following programming languages
• Java, C#, Ruby, Python, JavaScript (Node.js)
• Selenium WebDriver will support following browsers
• Google Chrome, Internet Explorer, Firefox, Safari, Opera, Edge
(Win 10)
Overview of Selenium WebDriver
Page 4Classification: Restricted
• Selenium WebDriver is available from Selenium official website
(http://www.seleniumhq.org)
• It is an open source and free software
• Source code is available in
https://github.com/SeleniumHQ/selenium
Get Selenium WebDriver Java
Page 5Classification: Restricted
• Install Java JDK (1.8 is recommended)
• Install Java IDE (Eclipse Kepler)
• Download Selenium Java jar files
(http://www.seleniumhq.org/download/)
• Install and configure browsers in the system
• Download required browser driver
Selenium – JAVA configuration
Page 6Classification: Restricted
• Open Eclipse with Workspace
• Create a new Java project (As
mentioned in the Core Java
session)
• Right click on the project and go
to Build Path -> Configure Build
Path
Selenium – JAVA Project creation
Page 7Classification: Restricted
Selenium – JAVA Project creation
7
• Go to Libraries Tab and click on Add External Jars… to select selenium Jar
files
• Select all jars which are download then click on Open and click on OK
Page 8Classification: Restricted
WebDriver in Different Browsers
8
• Google Chrome
• Mozilla Firefox
• MS Internet Explorer
• Safari
WebDriver driver;
System.setProperty("webdriver.chrome.driver", “<<Path of
chromedriver.exe>>");
driver = new ChromeDriver();
System.setProperty("webdriver.gecko.driver", “<<path of
geckodriver.exe>>");
driver = new FirefoxDriver();
System.setProperty(“webdriver.ie.driver ",“<<Path of
IEDriverServer.exe>>");
driver = new InternetExplorerDriver();
driver = new SafariDriver();
Page 9Classification: Restricted
• MS Edge(Windows 10)
System.setProperty("webdriver.edge.driver", “<<path of
MicrosoftWebDriver.exe“>>);
driver = new EdgeDriver();
WebDriver in Different Browsers
Page 10Classification: Restricted
• Pre-requisites to open a URL
• Browser need to be installed
• Browser driver need to upgrade based on browser version
• Browser zoom level should be 100%
• Syntax to open url is,
driver.get(“http://google.com/”);
Open Application
Page 11Classification: Restricted
• For Internet Explorer,
• On IE 7 or higher on Windows, must set the Protected Mode
settings for each zone to be the same value.
• The value can be on or off, as long as it is the same for every
zone.
Browser Settings
Page 12Classification: Restricted
• To set the Protected Mode settings,
choose "Internet Options..." from
the Tools menu, and click on the
Security tab.
• For each zone, there will be a check
box at the bottom of the tab
labeled "Enable Protected Mode"
Browser Settings
Page 13Classification: Restricted
• Locating elements in WebDriver is done by using the
findElement(By.locator()) method
Variati
on
Description Sample
By.id
locates elements by the
value of their "id" attribute
findElement(By.id("someId
"))
By.nam
e
locates elements by the
value of the "name"
attribute
findElement(By.name("so
meName"))
By.linkT
ext
finds a link element by the
exact text it displays
findElement(By.linkText("R
EGISTRATION"))
By.parti
alLinkTe
xt
locates elements that
contain the given link text
findElement(By.partialLink
Text("REG"))
By.cssS
elector
finds elements based on the
driver's underlying CSS
Selector engine
findElement(By.cssSelector
("input#email"))
Locating Elements
Page 14Classification: Restricted
Variati
on
Description Sample
By.class
Name
finds elements based on the
value of the "class" attribute
findElement(By.className
("someClassName"))
By.tagN
ame
locates elements by their tag
name
findElement(By.tagName("
div"))
By.xpat
h
locates elements via XPath
findElement(By.xpath(“//in
put[@id=‘username’]"))
Locating Elements
Page 15Classification: Restricted
IE Developer tool:
• Press F12 to open developer tool
• Click on the arrow key to select the object to get the property
• Click on Attribute to get different object attributes
Object Identification Methods
Page 16Classification: Restricted
Chrome: Inspect element
• Right click on the object you want identify and select Inspect element
option
• Find different properties available with the object or right click on
highlighted code and select copy CSS path or Copy Xpath
Object Identification Methods
Page 17Classification: Restricted
Firefox: Inspect element
• Right click on the object you want identify and select Inspect element
(Q) option
• Find different properties available with the object
Firebug (Firefox add-on)
• Firebug has different methods to select the object properties
• Find for the code
• Select properties for DOM
• Copy Xpath
• Copy CSS file
Object Identification Methods
Page 18Classification: Restricted
Selenium IDE
• Enter the object property Target column and click on Find button to
check the object
• Click on Select and highlight the object to get the object properties
Object Identification Methods
Page 19Classification: Restricted
The Id strategy looks for an element in the page having an id attribute
corresponding to the specified pattern. <label id="my_id" /> will be matched
by a locator like id=my_id or just my_id
driver.findElement(By.id("my_id"));
Locator ID
Page 20Classification: Restricted
Is the Id strategy, but on the name attribute
<html>
<body>
<div id="pancakes">
<button type="button" name="pancake“
value="Blueberry">Blueberry</button>
</div>
</body>
</html>
driver.findElement(By.name("pancake"));
Locator Name
Page 21Classification: Restricted
select links only and selects the anchor element containing the specified
text: link=The text of the link
<a href="http://www.phptravels.net/offers.html" target="_self">
Offers</a>
driver.findElement(By.linkText("Offers"));
Locators -LinkText
Page 22Classification: Restricted
 select links only and selects the anchor element containing the
specified text: link=The text of the link and take the part of the link
 <a
href="mercuryunderconst.php?osCsid=af0ce02d7eb466b9a4ec43f
2d5273db9">Car Rentals</a>
driver.findElement(By.partialLinkText("Ren"));
Locators -partialLinkText
Page 23Classification: Restricted
 CSS Selectors are string patterns used to identify an element based
on a combination of HTML tag, id, class, and attributes. Locating by
CSS Selector is more complicated than the previous methods, but it
is the most common locating strategy of advanced Selenium users
because it can access even those elements that have no ID or
name.
driver.findElement(By.cssSelector("input #usernme"));
Locators -CSS
Page 24Classification: Restricted
 XPath is the standard navigation tool for XML; and an HTML
document is also an XML document (xHTML). XPath is used
everywhere where there is XML.
 It can access almost any element, even those without class, name,
or id attributes.
 It is the most complicated method of identifying elements because
of too many different rules and considerations.
driver.findElement(By.xpath("//input[@id = 'usernme']"));
Locators -Xpath
Page 25Classification: Restricted
 Dropdown, Multi select
 Declare the drop-down element
 Select elmDrp=new Select
(WebElement)
 elmDrp.selectByVisibleText(”text
”)
 deselectByVisibleText()
 selectByIndex()
 deselectByIndex()
 isMultiple()
 deselectAll()
 Text Fields
 .sendKeys(“value”)
 .clear()
 Radio button, Link
 .click()
 Checkbox
 .click()
 .isSelected()
Accessing Different Objects in Application
Page 26Classification: Restricted
 Switching Between Frames
 driver.switchTo().frame(“FrameName”)
 Switching Between Pop-up Windows
 driver.switchTo().alert()
 Get pop-up message
 driver.switchTo().alert().getText()
 Click on OK on pop-up
 driver.switchTo().alert().accept()
Switch Window
Page 27Classification: Restricted
 Implicit wait
 Used to set the default waiting time throughout the program
 driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
 Explicit wait
 used to set the waiting time for a particular instance only
 WebDriverWait wait = new WebDriverWait(driver,10);
 wait.until(ExpectedConditions.visibilityOfElementLocated(By.n
ame("userName")));
Wait in WebDriver
Page 28Classification: Restricted
 Check object exist
 driver.findElements(obj).size()
 driver.findElement(obj).isDisplayed()
 isEnabled()
 isDisplayed()
 isSelected()
 elementToBeClickable()
 frameToBeAvailableAndSwitchToIt()
Verifications
Page 29Classification: Restricted
 To get items from a table we can create object by table xpath
 To get value from different row and column create dynamic object
run time
 String xpath = "//table[@width="270"]/tbody/tr[" + row +
"]/td[" + col + "]";
 driver.findElement(By.xpath(xpath)).getText();
 Can create table xpath with some unique property
WebTable
Page 30Classification: Restricted
Question?
3
Page 31Classification: Restricted
Thank You

More Related Content

What's hot

Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Simplilearn
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Aneesh Rangarajan
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
Tzirla Rozental
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
Zeba Tahseen
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
Return on Intelligence
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Framework
valuebound
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
Express JS
Express JSExpress JS
Express JS
Designveloper
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
Naresh Chintalcheru
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
Deepak Kumar Digar
 
Webinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation UncomplicatedWebinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation Uncomplicated
Edureka!
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automation
Srikanth Vuriti
 
Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium
Zoe Gilbert
 
SELENIUM PPT.pdf
SELENIUM PPT.pdfSELENIUM PPT.pdf
SELENIUM PPT.pdf
RebelSnowball
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
Vijay Rangaiah
 
Python Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + JenkinsPython Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + Jenkins
Fagun Priyadarshi
 
QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
Qspiders - Software Testing Training Institute
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
SQALab
 

What's hot (20)

Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Selenium- A Software Testing Tool
Selenium- A Software Testing ToolSelenium- A Software Testing Tool
Selenium- A Software Testing Tool
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Framework
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
Selenium
SeleniumSelenium
Selenium
 
Express JS
Express JSExpress JS
Express JS
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
 
Webinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation UncomplicatedWebinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation Uncomplicated
 
Selenium test automation
Selenium test automationSelenium test automation
Selenium test automation
 
Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium  Page Object Model and Implementation in Selenium
Page Object Model and Implementation in Selenium
 
SELENIUM PPT.pdf
SELENIUM PPT.pdfSELENIUM PPT.pdf
SELENIUM PPT.pdf
 
Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
 
Python Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + JenkinsPython Automation With Gauge + Selenium + API + Jenkins
Python Automation With Gauge + Selenium + API + Jenkins
 
QSpiders - Automation using Selenium
QSpiders - Automation using SeleniumQSpiders - Automation using Selenium
QSpiders - Automation using Selenium
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 

Similar to Selenium WebDriver with Java

Web driver training
Web driver trainingWeb driver training
Web driver training
Dipesh Bhatewara
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6Marakana Inc.
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6
Marakana Inc.
 
Introduction to selenium web driver
Introduction to selenium web driverIntroduction to selenium web driver
Introduction to selenium web driver
Return on Intelligence
 
Selenium training
Selenium trainingSelenium training
Selenium training
Shivaraj R
 
What is the taste of the Selenide
What is the taste of the SelenideWhat is the taste of the Selenide
What is the taste of the Selenide
Roman Marinsky
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
orbitprojects
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
Doris Chen
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Roy de Kleijn
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
vodQA
 
Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver
Vibrant Technologies & Computers
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Dave Haeffner
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testingdrewz lin
 
Escape from the automation hell
Escape from the automation hellEscape from the automation hell
Escape from the automation hell
Nikita Simonovets
 
Complete_QA_Automation_Guide__1696637878.pdf
Complete_QA_Automation_Guide__1696637878.pdfComplete_QA_Automation_Guide__1696637878.pdf
Complete_QA_Automation_Guide__1696637878.pdf
ramya9288
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
Sun Technlogies
 
Android testing-with-selenium-webdriver Online Training
Android testing-with-selenium-webdriver Online TrainingAndroid testing-with-selenium-webdriver Online Training
Android testing-with-selenium-webdriver Online Training
Nagendra Kumar
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutionswoutervugt
 
Latest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdfLatest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdf
Varsha Rajput
 

Similar to Selenium WebDriver with Java (20)

Web driver training
Web driver trainingWeb driver training
Web driver training
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6
 
Introduction to selenium web driver
Introduction to selenium web driverIntroduction to selenium web driver
Introduction to selenium web driver
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
What is the taste of the Selenide
What is the taste of the SelenideWhat is the taste of the Selenide
What is the taste of the Selenide
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
J query module1
J query module1J query module1
J query module1
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
 
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect ModelComprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
Comprehensive Browser Automation Solution using Groovy, WebDriver & Obect Model
 
Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver Selenium testing - Handle Elements in WebDriver
Selenium testing - Handle Elements in WebDriver
 
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium MeetupSelenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
 
Top100summit 谷歌-scott-improve your automated web application testing
Top100summit  谷歌-scott-improve your automated web application testingTop100summit  谷歌-scott-improve your automated web application testing
Top100summit 谷歌-scott-improve your automated web application testing
 
Escape from the automation hell
Escape from the automation hellEscape from the automation hell
Escape from the automation hell
 
Complete_QA_Automation_Guide__1696637878.pdf
Complete_QA_Automation_Guide__1696637878.pdfComplete_QA_Automation_Guide__1696637878.pdf
Complete_QA_Automation_Guide__1696637878.pdf
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Android testing-with-selenium-webdriver Online Training
Android testing-with-selenium-webdriver Online TrainingAndroid testing-with-selenium-webdriver Online Training
Android testing-with-selenium-webdriver Online Training
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutions
 
Latest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdfLatest Selenium Interview Questions And Answers.pdf
Latest Selenium Interview Questions And Answers.pdf
 

More from Fayis-QA

HP LoadRunner
HP LoadRunnerHP LoadRunner
HP LoadRunner
Fayis-QA
 
VBScript in Software Testing
VBScript in Software TestingVBScript in Software Testing
VBScript in Software Testing
Fayis-QA
 
Core Java Basics
Core Java BasicsCore Java Basics
Core Java Basics
Fayis-QA
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
Fayis-QA
 
HP ALM QC
HP ALM QCHP ALM QC
HP ALM QC
Fayis-QA
 
Defect Life Cycle
Defect Life CycleDefect Life Cycle
Defect Life Cycle
Fayis-QA
 
Testing Concepts and Manual Testing
Testing Concepts and Manual TestingTesting Concepts and Manual Testing
Testing Concepts and Manual Testing
Fayis-QA
 
Quality Standard
Quality StandardQuality Standard
Quality Standard
Fayis-QA
 
Agile in QA
Agile in QAAgile in QA
Agile in QA
Fayis-QA
 
SDLC
SDLCSDLC
SDLC
Fayis-QA
 
Introduction to Software Testing Part- 2
Introduction to Software Testing Part- 2Introduction to Software Testing Part- 2
Introduction to Software Testing Part- 2
Fayis-QA
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
Fayis-QA
 
Test Strategies and Planning
Test Strategies and PlanningTest Strategies and Planning
Test Strategies and Planning
Fayis-QA
 
Agile
Agile Agile
Agile
Fayis-QA
 
Test Management
Test ManagementTest Management
Test Management
Fayis-QA
 
Types of Testing
Types of TestingTypes of Testing
Types of Testing
Fayis-QA
 

More from Fayis-QA (16)

HP LoadRunner
HP LoadRunnerHP LoadRunner
HP LoadRunner
 
VBScript in Software Testing
VBScript in Software TestingVBScript in Software Testing
VBScript in Software Testing
 
Core Java Basics
Core Java BasicsCore Java Basics
Core Java Basics
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
 
HP ALM QC
HP ALM QCHP ALM QC
HP ALM QC
 
Defect Life Cycle
Defect Life CycleDefect Life Cycle
Defect Life Cycle
 
Testing Concepts and Manual Testing
Testing Concepts and Manual TestingTesting Concepts and Manual Testing
Testing Concepts and Manual Testing
 
Quality Standard
Quality StandardQuality Standard
Quality Standard
 
Agile in QA
Agile in QAAgile in QA
Agile in QA
 
SDLC
SDLCSDLC
SDLC
 
Introduction to Software Testing Part- 2
Introduction to Software Testing Part- 2Introduction to Software Testing Part- 2
Introduction to Software Testing Part- 2
 
Test Case Design and Technique
Test Case Design and TechniqueTest Case Design and Technique
Test Case Design and Technique
 
Test Strategies and Planning
Test Strategies and PlanningTest Strategies and Planning
Test Strategies and Planning
 
Agile
Agile Agile
Agile
 
Test Management
Test ManagementTest Management
Test Management
 
Types of Testing
Types of TestingTypes of Testing
Types of Testing
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 

Selenium WebDriver with Java

  • 1. Quality Assurance / Software Testing Training
  • 2. Page 2Classification: Restricted Agenda • Overview of Selenium WebDriver • Get Selenium WebDriver Java • Selenium – JAVA Configuration • WebDriver in Different Browsers • Open Application • Browser Settings • Locating Elements • Object Identification Methods • Locator ID, Name • Locators –LinkText, partialLinkText, CSS, CSS • Accessing different objects in application • Switch Window • Wait in WebDriver • Verifications • WebTable
  • 3. Page 3Classification: Restricted • Selenium WebDriver - is latest version of Selenium (Selenium 2/3) • WebDriver is a compact Object Oriented API when compared to Selenium1.0 • It drives the browser much more effectively • WebDriver will support following programming languages • Java, C#, Ruby, Python, JavaScript (Node.js) • Selenium WebDriver will support following browsers • Google Chrome, Internet Explorer, Firefox, Safari, Opera, Edge (Win 10) Overview of Selenium WebDriver
  • 4. Page 4Classification: Restricted • Selenium WebDriver is available from Selenium official website (http://www.seleniumhq.org) • It is an open source and free software • Source code is available in https://github.com/SeleniumHQ/selenium Get Selenium WebDriver Java
  • 5. Page 5Classification: Restricted • Install Java JDK (1.8 is recommended) • Install Java IDE (Eclipse Kepler) • Download Selenium Java jar files (http://www.seleniumhq.org/download/) • Install and configure browsers in the system • Download required browser driver Selenium – JAVA configuration
  • 6. Page 6Classification: Restricted • Open Eclipse with Workspace • Create a new Java project (As mentioned in the Core Java session) • Right click on the project and go to Build Path -> Configure Build Path Selenium – JAVA Project creation
  • 7. Page 7Classification: Restricted Selenium – JAVA Project creation 7 • Go to Libraries Tab and click on Add External Jars… to select selenium Jar files • Select all jars which are download then click on Open and click on OK
  • 8. Page 8Classification: Restricted WebDriver in Different Browsers 8 • Google Chrome • Mozilla Firefox • MS Internet Explorer • Safari WebDriver driver; System.setProperty("webdriver.chrome.driver", “<<Path of chromedriver.exe>>"); driver = new ChromeDriver(); System.setProperty("webdriver.gecko.driver", “<<path of geckodriver.exe>>"); driver = new FirefoxDriver(); System.setProperty(“webdriver.ie.driver ",“<<Path of IEDriverServer.exe>>"); driver = new InternetExplorerDriver(); driver = new SafariDriver();
  • 9. Page 9Classification: Restricted • MS Edge(Windows 10) System.setProperty("webdriver.edge.driver", “<<path of MicrosoftWebDriver.exe“>>); driver = new EdgeDriver(); WebDriver in Different Browsers
  • 10. Page 10Classification: Restricted • Pre-requisites to open a URL • Browser need to be installed • Browser driver need to upgrade based on browser version • Browser zoom level should be 100% • Syntax to open url is, driver.get(“http://google.com/”); Open Application
  • 11. Page 11Classification: Restricted • For Internet Explorer, • On IE 7 or higher on Windows, must set the Protected Mode settings for each zone to be the same value. • The value can be on or off, as long as it is the same for every zone. Browser Settings
  • 12. Page 12Classification: Restricted • To set the Protected Mode settings, choose "Internet Options..." from the Tools menu, and click on the Security tab. • For each zone, there will be a check box at the bottom of the tab labeled "Enable Protected Mode" Browser Settings
  • 13. Page 13Classification: Restricted • Locating elements in WebDriver is done by using the findElement(By.locator()) method Variati on Description Sample By.id locates elements by the value of their "id" attribute findElement(By.id("someId ")) By.nam e locates elements by the value of the "name" attribute findElement(By.name("so meName")) By.linkT ext finds a link element by the exact text it displays findElement(By.linkText("R EGISTRATION")) By.parti alLinkTe xt locates elements that contain the given link text findElement(By.partialLink Text("REG")) By.cssS elector finds elements based on the driver's underlying CSS Selector engine findElement(By.cssSelector ("input#email")) Locating Elements
  • 14. Page 14Classification: Restricted Variati on Description Sample By.class Name finds elements based on the value of the "class" attribute findElement(By.className ("someClassName")) By.tagN ame locates elements by their tag name findElement(By.tagName(" div")) By.xpat h locates elements via XPath findElement(By.xpath(“//in put[@id=‘username’]")) Locating Elements
  • 15. Page 15Classification: Restricted IE Developer tool: • Press F12 to open developer tool • Click on the arrow key to select the object to get the property • Click on Attribute to get different object attributes Object Identification Methods
  • 16. Page 16Classification: Restricted Chrome: Inspect element • Right click on the object you want identify and select Inspect element option • Find different properties available with the object or right click on highlighted code and select copy CSS path or Copy Xpath Object Identification Methods
  • 17. Page 17Classification: Restricted Firefox: Inspect element • Right click on the object you want identify and select Inspect element (Q) option • Find different properties available with the object Firebug (Firefox add-on) • Firebug has different methods to select the object properties • Find for the code • Select properties for DOM • Copy Xpath • Copy CSS file Object Identification Methods
  • 18. Page 18Classification: Restricted Selenium IDE • Enter the object property Target column and click on Find button to check the object • Click on Select and highlight the object to get the object properties Object Identification Methods
  • 19. Page 19Classification: Restricted The Id strategy looks for an element in the page having an id attribute corresponding to the specified pattern. <label id="my_id" /> will be matched by a locator like id=my_id or just my_id driver.findElement(By.id("my_id")); Locator ID
  • 20. Page 20Classification: Restricted Is the Id strategy, but on the name attribute <html> <body> <div id="pancakes"> <button type="button" name="pancake“ value="Blueberry">Blueberry</button> </div> </body> </html> driver.findElement(By.name("pancake")); Locator Name
  • 21. Page 21Classification: Restricted select links only and selects the anchor element containing the specified text: link=The text of the link <a href="http://www.phptravels.net/offers.html" target="_self"> Offers</a> driver.findElement(By.linkText("Offers")); Locators -LinkText
  • 22. Page 22Classification: Restricted  select links only and selects the anchor element containing the specified text: link=The text of the link and take the part of the link  <a href="mercuryunderconst.php?osCsid=af0ce02d7eb466b9a4ec43f 2d5273db9">Car Rentals</a> driver.findElement(By.partialLinkText("Ren")); Locators -partialLinkText
  • 23. Page 23Classification: Restricted  CSS Selectors are string patterns used to identify an element based on a combination of HTML tag, id, class, and attributes. Locating by CSS Selector is more complicated than the previous methods, but it is the most common locating strategy of advanced Selenium users because it can access even those elements that have no ID or name. driver.findElement(By.cssSelector("input #usernme")); Locators -CSS
  • 24. Page 24Classification: Restricted  XPath is the standard navigation tool for XML; and an HTML document is also an XML document (xHTML). XPath is used everywhere where there is XML.  It can access almost any element, even those without class, name, or id attributes.  It is the most complicated method of identifying elements because of too many different rules and considerations. driver.findElement(By.xpath("//input[@id = 'usernme']")); Locators -Xpath
  • 25. Page 25Classification: Restricted  Dropdown, Multi select  Declare the drop-down element  Select elmDrp=new Select (WebElement)  elmDrp.selectByVisibleText(”text ”)  deselectByVisibleText()  selectByIndex()  deselectByIndex()  isMultiple()  deselectAll()  Text Fields  .sendKeys(“value”)  .clear()  Radio button, Link  .click()  Checkbox  .click()  .isSelected() Accessing Different Objects in Application
  • 26. Page 26Classification: Restricted  Switching Between Frames  driver.switchTo().frame(“FrameName”)  Switching Between Pop-up Windows  driver.switchTo().alert()  Get pop-up message  driver.switchTo().alert().getText()  Click on OK on pop-up  driver.switchTo().alert().accept() Switch Window
  • 27. Page 27Classification: Restricted  Implicit wait  Used to set the default waiting time throughout the program  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);  Explicit wait  used to set the waiting time for a particular instance only  WebDriverWait wait = new WebDriverWait(driver,10);  wait.until(ExpectedConditions.visibilityOfElementLocated(By.n ame("userName"))); Wait in WebDriver
  • 28. Page 28Classification: Restricted  Check object exist  driver.findElements(obj).size()  driver.findElement(obj).isDisplayed()  isEnabled()  isDisplayed()  isSelected()  elementToBeClickable()  frameToBeAvailableAndSwitchToIt() Verifications
  • 29. Page 29Classification: Restricted  To get items from a table we can create object by table xpath  To get value from different row and column create dynamic object run time  String xpath = "//table[@width="270"]/tbody/tr[" + row + "]/td[" + col + "]";  driver.findElement(By.xpath(xpath)).getText();  Can create table xpath with some unique property WebTable