Please anyone explain with an example how Implicit wait can be used in Selenium Webdriver

+1 vote
Please anyone explain with an example how Implicit wait can be used in Selenium Webdriver?
Jul 23, 2019 in Selenium by Kartik
1,279 views

2 answers to this question.

+1 vote

Hello Kartik, following piece of code can help you in understanding Implicit wait and how it can be used in Selenium:

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

import org.testng.annotations.Test;

public class VerifyTitle

{

                @Test

                public void verifyPageTitle()

                {

                                WebDriver driver=new FirefoxDriver();

                                driver.manage().window().maximize();

                                driver.get("http://www.facebook.com");

                                // Specify implicit wait of 30 seconds                                   
                                 driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

                              // No login id is present on Webpage so this will fail our script.
                                driver.findElement(By.id("login")).sendKeys(" Abha Rathour");

                }

}
answered Jul 23, 2019 by Abha
• 28,140 points
+1 vote
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
answered Dec 24, 2019 by Sandy
Thanks @Sandy

This one line was all I needed.
hello @Sandy! I hope you are doing fine. Please do register at Edureka Community and earn credits for all your contribution(asking a question, answering, commenting or even upvoting)

Related Questions In Selenium

0 votes
1 answer

Can anyone explain how an AJAX call can be handled in Selenium webdriver?

Hello Megha, to demonstrate how AJAX calls are ...READ MORE

answered May 9, 2019 in Selenium by Pratibha
• 3,690 points
1,423 views
0 votes
1 answer
0 votes
1 answer

Can anyone demonstrate how navigation commands can be used on a webpage in Selenium?

Hey Amanprit, Navigation Commands are used to ...READ MORE

answered Jul 5, 2019 in Selenium by Anvi
• 14,150 points
656 views
0 votes
1 answer
0 votes
1 answer

Impilicit wait vs Explicit wait vs Fluent wait

Implicit wait: Your telling the WebDriver the ...READ MORE

answered Apr 14, 2018 in Selenium by king_kenny
• 3,710 points
4,329 views
0 votes
1 answer

Implicit wait & Explicit wait in selenium WebDriver

Implicit Wait:  While loading a web page in ...READ MORE

answered May 24, 2018 in Selenium by Meci Matt
• 9,460 points
1,776 views
+1 vote
4 answers

Need to wait until page is completely loaded - Selenium WebDriver

You can try something like -  new WebDriverWait(firefoxDriver, ...READ MORE

answered Dec 21, 2019 in Selenium by Robin
64,303 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,687 views
0 votes
2 answers

Can anyone help me that how to run Selenium WebDriver test cases in Chrome?

You first need to download chrome driver ...READ MORE

answered Aug 26, 2019 in Selenium by Abha
• 28,140 points
1,975 views
0 votes
1 answer

How can we read data from an excel sheet in Selenium webdriver?

Hi Tarun, to read data from an ...READ MORE

answered May 8, 2019 in Selenium by Abha
• 28,140 points
17,584 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