SlideShare a Scribd company logo
Selenium WebDriver locate, Wait and
Input
Kadarkarai Selvam
findElement : By
findElements
findElements will return the list of all elements with the same locate value
List<WebElement> elementNames =
driver.findElements(By.className("classname"));
Example
for (int i=0; i<elementNames.size();i++){
System.out.println(elementNames.get(i));}
Handling Waits
❖ Page loading takes time and wait is used to handle that time
❖ Default waiting time is present as Thread.sleep(3000);
❖ If Element is not found, then ElementNotVisibleException exception will be
thrown in the script
❖ Two types of Waits are present
➢ Implicit Wait
➢ Explicit Wait
Implicit Waits
❖ This Wait will tell the web driver to hold on for a certain amount of time before it
throws a “No Such Element Exception”.
driver.manage().timeouts().implicitlyWait(TimeOut,
TimeUnit.SECONDS);
❖ First parameter can be a numeric whole value &
❖ Second parameter can be of SECONDS, MINUTES, MILISECOND, MICROSECONDS,
NANOSECONDS, DAYS, HOURS
Explicit Wait
This wait is based on a certain conditions
WebDriverWait wait = new WebDriverWait(WebDriverRefrence,TimeOut);
E.g.
wait.until(ExpectedConditions.elementToBeClickable(By.id("")));
Explicit Waits : Expected Conditions
1. alertIsPresent()
2. elementSelectionStateToBe()
3. elementToBeClickable()
4. elementToBeSelected()
5. frameToBeAvaliableAndSwitchToIt()
6. invisibilityOfTheElementLocated()
7. invisibilityOfElementWithText()
8. presenceOfAllElementsLocatedBy()
9. presenceOfElementLocated()
10. textToBePresentInElement()
11. textToBePresentInElementLocated()
12. textToBePresentInElementValue()
13. titleIs()
14. titleContains()
15. visibilityOf()
16. visibilityOfAllElements()
17. visibilityOfAllElementsLocatedBy()
18. visibilityOfElementLocated()
Fluency Wait
❖ Fluency wait gives additional control in the script
❖ Wait for a condition, wait frequency with which it can check & Ignore an exception
Wait wait = new FluentWait(WebDriver reference)
.withTimeout(timeout, SECONDS)
.pollingEvery(timeout, SECONDS)
.ignoring(Exception.class);
Example
wait.until(ExpectedConditions.alertIsPresent());
Textbox
driver.findElement(By.id(“”)).click();
driver.findElement(By.id(“”)).sendKeys(“”);
driver.findElement(By.id(“”)).clear(“”);
Select Value
Select thisselect = new
Select(driver.findElement(By.name("dropdown")));
❖ Selects the value from
selectByIndex
selectByValue
selectByVisibleText
Thank you
For any Assistance
kadarkarai@live.com
+91-9578921178

More Related Content

What's hot (15)

PDF
Entity Component System - for App developers
Maxim Zaks
 
DOCX
Experienced Selenium Interview questions
archana singh
 
PDF
Nestjs MasterClass Slides
Nir Kaufman
 
PDF
Martin Anderson - threads v actors
bloodredsun
 
PDF
Reactotron - A Debugging Agent
Matthieu Vachon
 
PPTX
Deceptive simplicity of async and await
Andrei Marukovich
 
PPT
Servlet11
patinijava
 
PDF
Device Simulator with Akka
Max Huang
 
PPTX
16 18
Erick Regalado
 
ZIP
Introduction to SQLite in Adobe AIR 1.5
Peter Elst
 
PDF
Servlet Filter
AshishSingh Bhatia
 
PDF
End to end todo list app with NestJs - Angular - Redux & Redux Saga
Babacar NIANG
 
PDF
CLS & asyncListener: asynchronous observability for Node.js
Forrest Norvell
 
PDF
Fetch data from form
Shahriar Malik
 
PDF
How to instantiate any view controller for free
BenotCaron
 
Entity Component System - for App developers
Maxim Zaks
 
Experienced Selenium Interview questions
archana singh
 
Nestjs MasterClass Slides
Nir Kaufman
 
Martin Anderson - threads v actors
bloodredsun
 
Reactotron - A Debugging Agent
Matthieu Vachon
 
Deceptive simplicity of async and await
Andrei Marukovich
 
Servlet11
patinijava
 
Device Simulator with Akka
Max Huang
 
Introduction to SQLite in Adobe AIR 1.5
Peter Elst
 
Servlet Filter
AshishSingh Bhatia
 
End to end todo list app with NestJs - Angular - Redux & Redux Saga
Babacar NIANG
 
CLS & asyncListener: asynchronous observability for Node.js
Forrest Norvell
 
Fetch data from form
Shahriar Malik
 
How to instantiate any view controller for free
BenotCaron
 

Similar to Selenium inputs (20)

PDF
How to Use Selenium Waits_ A Step-by-Step Guide.pdf
Steve Wortham
 
PPTX
Different wait methods or commands in Selenium
Vinay Kumar Pulabaigari
 
PDF
waits.pdf
ssuser0562f1
 
PDF
Yaroslav Pernerovsky - You are doing it wrong all the time
Ievgenii Katsan
 
PDF
Implicit and Explicit waits in Selenium WebDriwer, how to.
Yaroslav Pernerovsky
 
PPT
Java. Explicit and Implicit Wait. Testing Ajax Applications
Марія Русин
 
PDF
waits.pdf
ssuser0562f1
 
PDF
WebDriver Waits
Yaroslav Pernerovsky
 
PPTX
Handling Exceptions and waits in selenium.pptx
Madhuri Lonikar
 
PPTX
Waits alerts and switch windows
Ducat
 
PDF
Waits in Selenium | Selenium Wait Commands | Edureka
Edureka!
 
PPTX
Synchronization in Selenium WebDriver
SHUBHAM PATIL
 
PPTX
Presentation(Q3).pptxgdfgfgwdfwgdfwgdfwgdfwwwgsvwgdvgdvgdvwg
utsavaggarwal8
 
PPTX
2016 09-09 - Selenium Webdriver - Fundamentals + Hands-on!
Alfonso Peletier
 
PPTX
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Edureka!
 
PDF
Selenium Implicit vs Explicit Waits.pdf
MounikaPolabathina
 
PPTX
Web driver training
Dipesh Bhatewara
 
PDF
findElement and findElements in Selenium_ Use Cases with Examples.pdf
Steve Wortham
 
PDF
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
 
PPTX
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
devopsdaysaustin
 
How to Use Selenium Waits_ A Step-by-Step Guide.pdf
Steve Wortham
 
Different wait methods or commands in Selenium
Vinay Kumar Pulabaigari
 
waits.pdf
ssuser0562f1
 
Yaroslav Pernerovsky - You are doing it wrong all the time
Ievgenii Katsan
 
Implicit and Explicit waits in Selenium WebDriwer, how to.
Yaroslav Pernerovsky
 
Java. Explicit and Implicit Wait. Testing Ajax Applications
Марія Русин
 
waits.pdf
ssuser0562f1
 
WebDriver Waits
Yaroslav Pernerovsky
 
Handling Exceptions and waits in selenium.pptx
Madhuri Lonikar
 
Waits alerts and switch windows
Ducat
 
Waits in Selenium | Selenium Wait Commands | Edureka
Edureka!
 
Synchronization in Selenium WebDriver
SHUBHAM PATIL
 
Presentation(Q3).pptxgdfgfgwdfwgdfwgdfwgdfwwwgsvwgdvgdvgdvwg
utsavaggarwal8
 
2016 09-09 - Selenium Webdriver - Fundamentals + Hands-on!
Alfonso Peletier
 
Selenium Interview Questions and Answers | Selenium Tutorial | Selenium Train...
Edureka!
 
Selenium Implicit vs Explicit Waits.pdf
MounikaPolabathina
 
Web driver training
Dipesh Bhatewara
 
findElement and findElements in Selenium_ Use Cases with Examples.pdf
Steve Wortham
 
Selenium Introduction by Sandeep Sharda
Er. Sndp Srda
 
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
devopsdaysaustin
 
Ad

More from KadarkaraiSelvam (11)

PPTX
Selenium web driver useful commands
KadarkaraiSelvam
 
PPTX
Java 2
KadarkaraiSelvam
 
PPTX
Java 1
KadarkaraiSelvam
 
PPTX
Java selenium web driver
KadarkaraiSelvam
 
PPTX
Selenium TestNG
KadarkaraiSelvam
 
PPTX
Maven and versioning
KadarkaraiSelvam
 
PPTX
Java Inheritance and Polymorphism
KadarkaraiSelvam
 
PPTX
Java Control Statements
KadarkaraiSelvam
 
PPTX
Java JVM
KadarkaraiSelvam
 
PPTX
Java variables and classes
KadarkaraiSelvam
 
PPTX
Selenium ide 1
KadarkaraiSelvam
 
Selenium web driver useful commands
KadarkaraiSelvam
 
Java selenium web driver
KadarkaraiSelvam
 
Selenium TestNG
KadarkaraiSelvam
 
Maven and versioning
KadarkaraiSelvam
 
Java Inheritance and Polymorphism
KadarkaraiSelvam
 
Java Control Statements
KadarkaraiSelvam
 
Java variables and classes
KadarkaraiSelvam
 
Selenium ide 1
KadarkaraiSelvam
 
Ad

Recently uploaded (20)

PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 

Selenium inputs

  • 1. Selenium WebDriver locate, Wait and Input Kadarkarai Selvam
  • 3. findElements findElements will return the list of all elements with the same locate value List<WebElement> elementNames = driver.findElements(By.className("classname")); Example for (int i=0; i<elementNames.size();i++){ System.out.println(elementNames.get(i));}
  • 4. Handling Waits ❖ Page loading takes time and wait is used to handle that time ❖ Default waiting time is present as Thread.sleep(3000); ❖ If Element is not found, then ElementNotVisibleException exception will be thrown in the script ❖ Two types of Waits are present ➢ Implicit Wait ➢ Explicit Wait
  • 5. Implicit Waits ❖ This Wait will tell the web driver to hold on for a certain amount of time before it throws a “No Such Element Exception”. driver.manage().timeouts().implicitlyWait(TimeOut, TimeUnit.SECONDS); ❖ First parameter can be a numeric whole value & ❖ Second parameter can be of SECONDS, MINUTES, MILISECOND, MICROSECONDS, NANOSECONDS, DAYS, HOURS
  • 6. Explicit Wait This wait is based on a certain conditions WebDriverWait wait = new WebDriverWait(WebDriverRefrence,TimeOut); E.g. wait.until(ExpectedConditions.elementToBeClickable(By.id("")));
  • 7. Explicit Waits : Expected Conditions 1. alertIsPresent() 2. elementSelectionStateToBe() 3. elementToBeClickable() 4. elementToBeSelected() 5. frameToBeAvaliableAndSwitchToIt() 6. invisibilityOfTheElementLocated() 7. invisibilityOfElementWithText() 8. presenceOfAllElementsLocatedBy() 9. presenceOfElementLocated() 10. textToBePresentInElement() 11. textToBePresentInElementLocated() 12. textToBePresentInElementValue() 13. titleIs() 14. titleContains() 15. visibilityOf() 16. visibilityOfAllElements() 17. visibilityOfAllElementsLocatedBy() 18. visibilityOfElementLocated()
  • 8. Fluency Wait ❖ Fluency wait gives additional control in the script ❖ Wait for a condition, wait frequency with which it can check & Ignore an exception Wait wait = new FluentWait(WebDriver reference) .withTimeout(timeout, SECONDS) .pollingEvery(timeout, SECONDS) .ignoring(Exception.class); Example wait.until(ExpectedConditions.alertIsPresent());
  • 10. Select Value Select thisselect = new Select(driver.findElement(By.name("dropdown"))); ❖ Selects the value from selectByIndex selectByValue selectByVisibleText
  • 11. Thank you For any Assistance [email protected] +91-9578921178