SlideShare a Scribd company logo
1 of 11
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

Entity Component System - for App developers
Entity Component System - for App developersEntity Component System - for App developers
Entity Component System - for App developersMaxim Zaks
 
Experienced Selenium Interview questions
Experienced Selenium Interview questionsExperienced Selenium Interview questions
Experienced Selenium Interview questionsarchana singh
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass SlidesNir Kaufman
 
Martin Anderson - threads v actors
Martin Anderson - threads v actorsMartin Anderson - threads v actors
Martin Anderson - threads v actorsbloodredsun
 
Reactotron - A Debugging Agent
Reactotron -  A Debugging AgentReactotron -  A Debugging Agent
Reactotron - A Debugging AgentMatthieu Vachon
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and awaitAndrei Marukovich
 
Device Simulator with Akka
Device Simulator with AkkaDevice Simulator with Akka
Device Simulator with AkkaMax Huang
 
Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Peter Elst
 
End to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux SagaEnd to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux SagaBabacar NIANG
 
CLS & asyncListener: asynchronous observability for Node.js
CLS & asyncListener: asynchronous observability for Node.jsCLS & asyncListener: asynchronous observability for Node.js
CLS & asyncListener: asynchronous observability for Node.jsForrest Norvell
 
How to instantiate any view controller for free
How to instantiate any view controller for freeHow to instantiate any view controller for free
How to instantiate any view controller for freeBenotCaron
 

What's hot (15)

Entity Component System - for App developers
Entity Component System - for App developersEntity Component System - for App developers
Entity Component System - for App developers
 
Experienced Selenium Interview questions
Experienced Selenium Interview questionsExperienced Selenium Interview questions
Experienced Selenium Interview questions
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
 
Martin Anderson - threads v actors
Martin Anderson - threads v actorsMartin Anderson - threads v actors
Martin Anderson - threads v actors
 
Reactotron - A Debugging Agent
Reactotron -  A Debugging AgentReactotron -  A Debugging Agent
Reactotron - A Debugging Agent
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and await
 
Servlet11
Servlet11Servlet11
Servlet11
 
Device Simulator with Akka
Device Simulator with AkkaDevice Simulator with Akka
Device Simulator with Akka
 
16 18
16 1816 18
16 18
 
Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5Introduction to SQLite in Adobe AIR 1.5
Introduction to SQLite in Adobe AIR 1.5
 
Servlet Filter
Servlet FilterServlet Filter
Servlet Filter
 
End to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux SagaEnd to end todo list app with NestJs - Angular - Redux & Redux Saga
End to end todo list app with NestJs - Angular - Redux & Redux Saga
 
CLS & asyncListener: asynchronous observability for Node.js
CLS & asyncListener: asynchronous observability for Node.jsCLS & asyncListener: asynchronous observability for Node.js
CLS & asyncListener: asynchronous observability for Node.js
 
Fetch data from form
Fetch data from formFetch data from form
Fetch data from form
 
How to instantiate any view controller for free
How to instantiate any view controller for freeHow to instantiate any view controller for free
How to instantiate any view controller for free
 

Similar to Selenium inputs

Different wait methods or commands in Selenium
Different wait methods or commands in SeleniumDifferent wait methods or commands in Selenium
Different wait methods or commands in SeleniumVinay Kumar Pulabaigari
 
Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.Yaroslav Pernerovsky
 
Yaroslav Pernerovsky - You are doing it wrong all the time
Yaroslav Pernerovsky - You are doing it wrong all the timeYaroslav Pernerovsky - You are doing it wrong all the time
Yaroslav Pernerovsky - You are doing it wrong all the timeIevgenii Katsan
 
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.pdfVarsha Rajput
 
Servletand sessiontracking
Servletand sessiontrackingServletand sessiontracking
Servletand sessiontrackingvamsi krishna
 
Java. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsJava. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsМарія Русин
 
Synchronization in Selenium WebDriver
Synchronization in Selenium WebDriverSynchronization in Selenium WebDriver
Synchronization in Selenium WebDriverSHUBHAM PATIL
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesUnity Technologies
 
Automation Testing
Automation TestingAutomation Testing
Automation TestingRomSoft SRL
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answerskavinilavuG
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for BeginnersPooja Saxena
 
Core Data Performance Guide Line
Core Data Performance Guide LineCore Data Performance Guide Line
Core Data Performance Guide LineGagan Vishal Mishra
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmineTimothy Oxley
 

Similar to Selenium inputs (20)

Different wait methods or commands in Selenium
Different wait methods or commands in SeleniumDifferent wait methods or commands in Selenium
Different wait methods or commands in Selenium
 
Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.
 
Yaroslav Pernerovsky - You are doing it wrong all the time
Yaroslav Pernerovsky - You are doing it wrong all the timeYaroslav Pernerovsky - You are doing it wrong all the time
Yaroslav Pernerovsky - You are doing it wrong all the time
 
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
 
WebDriver Waits
WebDriver WaitsWebDriver Waits
WebDriver Waits
 
waits.pdf
waits.pdfwaits.pdf
waits.pdf
 
waits.pdf
waits.pdfwaits.pdf
waits.pdf
 
Servletand sessiontracking
Servletand sessiontrackingServletand sessiontracking
Servletand sessiontracking
 
Web driver training
Web driver trainingWeb driver training
Web driver training
 
Java. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax ApplicationsJava. Explicit and Implicit Wait. Testing Ajax Applications
Java. Explicit and Implicit Wait. Testing Ajax Applications
 
Synchronization in Selenium WebDriver
Synchronization in Selenium WebDriverSynchronization in Selenium WebDriver
Synchronization in Selenium WebDriver
 
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle GamesWe Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
We Love Performance! How Tic Toc Games Uses ECS in Mobile Puzzle Games
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answers
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
 
Core data optimization
Core data optimizationCore data optimization
Core data optimization
 
Core Data Performance Guide Line
Core Data Performance Guide LineCore Data Performance Guide Line
Core Data Performance Guide Line
 
Servlet session 6
Servlet   session 6Servlet   session 6
Servlet session 6
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
 
Servlet session 9
Servlet   session 9Servlet   session 9
Servlet session 9
 

More from KadarkaraiSelvam

More from KadarkaraiSelvam (11)

Selenium web driver useful commands
Selenium web driver useful commandsSelenium web driver useful commands
Selenium web driver useful commands
 
Java 2
Java 2Java 2
Java 2
 
Java 1
Java 1Java 1
Java 1
 
Java selenium web driver
Java selenium web driverJava selenium web driver
Java selenium web driver
 
Selenium TestNG
Selenium TestNGSelenium TestNG
Selenium TestNG
 
Maven and versioning
Maven and versioningMaven and versioning
Maven and versioning
 
Java Inheritance and Polymorphism
Java Inheritance and PolymorphismJava Inheritance and Polymorphism
Java Inheritance and Polymorphism
 
Java Control Statements
Java Control StatementsJava Control Statements
Java Control Statements
 
Java JVM
Java JVMJava JVM
Java JVM
 
Java variables and classes
Java variables and classesJava variables and classes
Java variables and classes
 
Selenium ide 1
Selenium ide 1Selenium ide 1
Selenium ide 1
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 

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 kadarkarai@live.com +91-9578921178