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
57 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
• 27,180 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,650 points
1,028 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,440 points
248 views
0 votes
2 answers
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,110 points
1,147 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 in Selenium by Abha
• 27,180 points
341 views
0 votes
1 answer