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

0 votes
Please anyone explain with an example how Implicit wait can be used in Selenium Webdriver?
Jul 22 in Selenium by Kartik
33 views

1 answer to this question.

0 votes

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 22 by Abha
• 19,130 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
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 13, 2018 in Selenium by king_kenny
• 3,610 points
695 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,400 points
145 views
0 votes
1 answer

Need to wait until page is completely loaded - Selenium WebDriver

Using Thread.Sleep(); is one approach; but its ...READ MORE

answered Apr 2, 2018 in Selenium by nsv999
• 5,050 points
4,107 views
0 votes
1 answer

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,050 points
403 views
0 votes
1 answer
0 votes
1 answer