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

PPTX
Rest assured
PPSX
Selenium WebDriver
PPTX
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
PPTX
Introduction to Selenium Web Driver
PPTX
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
PPTX
Data driven Automation Framework with Selenium
PDF
Selenium 4 with Simon Stewart [Webinar]
PDF
Xpath in Selenium | Selenium Xpath Tutorial | Selenium Xpath Examples | Selen...
Rest assured
Selenium WebDriver
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Introduction to Selenium Web Driver
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Data driven Automation Framework with Selenium
Selenium 4 with Simon Stewart [Webinar]
Xpath in Selenium | Selenium Xpath Tutorial | Selenium Xpath Examples | Selen...

What's hot (20)

PPTX
Test Automation and Selenium
PPTX
API Automation Testing Using RestAssured+Cucumber
PPTX
Testing RESTful web services with REST Assured
PDF
Automation Testing using Selenium
PPT
Selenium Presentation at Engineering Colleges
PPT
PDF
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
PDF
Selenium
PPTX
Automation Testing by Selenium Web Driver
PPT
Java Basics for selenium
PDF
The story of SonarQube told to a DevOps Engineer
PDF
Web application testing with Selenium
PPTX
Maven Basics - Explained
PPTX
Automation - web testing with selenium
PPTX
Introduction to selenium
PPT
PPT
Selenium
PPTX
Test at Scale within your Internal Networks with BrowserStack Local Testing
PPTX
Apresentação rest api
PPTX
Appium Presentation
Test Automation and Selenium
API Automation Testing Using RestAssured+Cucumber
Testing RESTful web services with REST Assured
Automation Testing using Selenium
Selenium Presentation at Engineering Colleges
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Selenium
Automation Testing by Selenium Web Driver
Java Basics for selenium
The story of SonarQube told to a DevOps Engineer
Web application testing with Selenium
Maven Basics - Explained
Automation - web testing with selenium
Introduction to selenium
Selenium
Test at Scale within your Internal Networks with BrowserStack Local Testing
Apresentação rest api
Appium Presentation
Ad

Similar to Selenium WebDriver with Java (20)

PPTX
Selenium training
PPTX
Session 02 - Object Identification - Part 1
PDF
Selenium Introduction by Sandeep Sharda
PPSX
Selenium WebDriver
PPTX
Selenium WebDriver
PPTX
Web driver training
PDF
Introduction to Selenium and Test Automation
PDF
Handson Selenium Webdriver With Java A Deep Dive Into The Development Of Endt...
PPTX
Locators and webdriver commands Selenium Session2.pptx
PPTX
Web testing with Selenium
PPTX
Selenium.pptx
PDF
Selenium bootcamp slides
PPTX
Agile_unit_2_newdddcdcdscdssvvdvdsvdsv.pptx
PPTX
Agile_unit_2_newdddcdcdscdssvvdvdsvdsv.pptx
DOCX
Experienced Selenium Interview questions
PPTX
Selenium web driver
PDF
How to use selenium successfully
PDF
Selenium Overview
PPTX
Automatedtestingwithselenium shubham jain
PDF
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Selenium training
Session 02 - Object Identification - Part 1
Selenium Introduction by Sandeep Sharda
Selenium WebDriver
Selenium WebDriver
Web driver training
Introduction to Selenium and Test Automation
Handson Selenium Webdriver With Java A Deep Dive Into The Development Of Endt...
Locators and webdriver commands Selenium Session2.pptx
Web testing with Selenium
Selenium.pptx
Selenium bootcamp slides
Agile_unit_2_newdddcdcdscdssvvdvdsvdsv.pptx
Agile_unit_2_newdddcdcdscdssvvdvdsvdsv.pptx
Experienced Selenium Interview questions
Selenium web driver
How to use selenium successfully
Selenium Overview
Automatedtestingwithselenium shubham jain
Selenium Tips & Tricks, presented at the Tel Aviv Selenium Meetup
Ad

More from Fayis-QA (16)

PPSX
HP LoadRunner
PPSX
VBScript in Software Testing
PPSX
Core Java Basics
PPSX
Introduction to Automation Testing
PPSX
HP ALM QC
PPSX
Defect Life Cycle
PPSX
Testing Concepts and Manual Testing
PPSX
Quality Standard
PPSX
Agile in QA
PPSX
SDLC
PPSX
Introduction to Software Testing Part- 2
PPSX
Test Case Design and Technique
PPSX
Test Strategies and Planning
PPSX
Agile
PPSX
Test Management
PPSX
Types of Testing
HP LoadRunner
VBScript in Software Testing
Core Java Basics
Introduction to Automation Testing
HP ALM QC
Defect Life Cycle
Testing Concepts and Manual Testing
Quality Standard
Agile in QA
SDLC
Introduction to Software Testing Part- 2
Test Case Design and Technique
Test Strategies and Planning
Agile
Test Management
Types of Testing

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation theory and applications.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Network Security Unit 5.pdf for BCA BBA.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

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