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

Entity Component System - for App developers
Entity Component System - for App developersEntity Component System - for App developers
Entity Component System - for App developers
Maxim Zaks
 
Experienced Selenium Interview questions
Experienced Selenium Interview questionsExperienced Selenium Interview questions
Experienced Selenium Interview questions
archana singh
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
Nir Kaufman
 
Martin Anderson - threads v actors
Martin Anderson - threads v actorsMartin Anderson - threads v actors
Martin Anderson - threads v actors
bloodredsun
 
Reactotron - A Debugging Agent
Reactotron -  A Debugging AgentReactotron -  A Debugging Agent
Reactotron - A Debugging Agent
Matthieu Vachon
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and await
Andrei Marukovich
 
Servlet11
Servlet11Servlet11
Servlet11
patinijava
 
Device Simulator with Akka
Device Simulator with AkkaDevice Simulator with Akka
Device Simulator with Akka
Max Huang
 
16 18
16 1816 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
Peter Elst
 
Servlet Filter
Servlet FilterServlet Filter
Servlet Filter
AshishSingh Bhatia
 
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
Babacar 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.js
Forrest Norvell
 
Fetch data from form
Fetch data from formFetch data from form
Fetch data from form
Shahriar Malik
 
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
BenotCaron
 

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 Selenium
Vinay 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 time
Ievgenii 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.pdf
Varsha Rajput
 
WebDriver Waits
WebDriver WaitsWebDriver Waits
WebDriver Waits
Yaroslav Pernerovsky
 
waits.pdf
waits.pdfwaits.pdf
waits.pdf
ssuser0562f1
 
waits.pdf
waits.pdfwaits.pdf
waits.pdf
ssuser0562f1
 
Servletand sessiontracking
Servletand sessiontrackingServletand sessiontracking
Servletand sessiontracking
vamsi krishna
 
Web driver training
Web driver trainingWeb driver training
Web driver training
Dipesh Bhatewara
 
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
SHUBHAM 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 Games
Unity Technologies
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
RomSoft SRL
 
Selenium interview questions and answers
Selenium interview questions and answersSelenium interview questions and answers
Selenium interview questions and answers
kavinilavuG
 
jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
Pooja Saxena
 
Core data optimization
Core data optimizationCore data optimization
Core data optimization
Gagan Vishal Mishra
 
Core Data Performance Guide Line
Core Data Performance Guide LineCore Data Performance Guide Line
Core Data Performance Guide Line
Gagan Vishal Mishra
 
Servlet session 6
Servlet   session 6Servlet   session 6
Servlet session 6
Anuj Singh Rajput
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
Timothy Oxley
 
Servlet session 9
Servlet   session 9Servlet   session 9
Servlet session 9
Anuj Singh Rajput
 

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

Selenium web driver useful commands
Selenium web driver useful commandsSelenium web driver useful commands
Selenium web driver useful commands
KadarkaraiSelvam
 
Java 2
Java 2Java 2
Java 1
Java 1Java 1
Java selenium web driver
Java selenium web driverJava selenium web driver
Java selenium web driver
KadarkaraiSelvam
 
Selenium TestNG
Selenium TestNGSelenium TestNG
Selenium TestNG
KadarkaraiSelvam
 
Maven and versioning
Maven and versioningMaven and versioning
Maven and versioning
KadarkaraiSelvam
 
Java Inheritance and Polymorphism
Java Inheritance and PolymorphismJava Inheritance and Polymorphism
Java Inheritance and Polymorphism
KadarkaraiSelvam
 
Java Control Statements
Java Control StatementsJava Control Statements
Java Control Statements
KadarkaraiSelvam
 
Java JVM
Java JVMJava JVM
Java variables and classes
Java variables and classesJava variables and classes
Java variables and classes
KadarkaraiSelvam
 
Selenium ide 1
Selenium ide 1Selenium ide 1
Selenium ide 1
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

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
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
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 

Recently uploaded (20)

Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
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
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 

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