How do I ask the Selenium-WebDriver to wait for few seconds in Java

+2 votes
I want to add a delay of few seconds in the Selenium WebDriver. How can I do that?
Dec 19, 2018 in Java by Sushmita
• 6,920 points

edited Dec 19, 2018 by Sushmita 949 views

1 answer to this question.

0 votes

There are two ways to wait: explicit and implicit wait. 

The idea of explicit wait is

WebDriverWait.until(condition-that-finds-the-element);

The idea of implicit wait is

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
fluentWait function returns your found web element.

answered Dec 19, 2018 by Daisy
• 8,140 points

edited Dec 19, 2018 by Daisy

Related Questions In Java

+1 vote
1 answer

if i given invalid data how to get alert in selenium using java

Hello, Here is some of the method you ...READ MORE

answered Jul 20, 2020 in Java by Niroj
• 82,840 points
1,216 views
0 votes
2 answers

How do I convert a String to an int in Java?

Use the lines of code mentioned below:- String ...READ MORE

answered Feb 9, 2022 in Java by Soham
• 9,710 points
3,208 views
0 votes
1 answer

How do I resolve the "java.net.BindException: Address already in use: JVM_Bind" error?

If you are aware about what port ...READ MORE

answered Feb 22, 2022 in Java by Aditya
• 7,680 points
5,109 views
0 votes
0 answers

How do I copy to the clipboard in JavaScript?

How can I copy text to the ...READ MORE

Sep 28, 2022 in Java by Nicholas
• 7,760 points
839 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,673 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,142 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,221 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,874 views
0 votes
2 answers
0 votes
2 answers

What is the use of toString method in Java and how can I use it ?

Whenever you require to explore the constructor ...READ MORE

answered Aug 23, 2018 in Java by Daisy
• 8,140 points
4,103 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP