difference between Implicit Wait and Explicit Wait with syntax.?

Answer Posted / smruti ranjan patri

MPLICIT WAIT:

WebDriver driver = new FirefoxDriver();

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("http://url_that_delays_loading");

WebElement myDynamicElement = driver.findElement(By.id("myDynamicElement"));


Explicitly wait :

WebDriverWait wait = new WebDriverWait(d,20);
wait.until(ExpectedConditions.presenceOfElementLocated(By.linkText("Any link")));

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we handle window ui elements and window pop ups using selenium?

447


What is the use of driver.get("url") and driver.navigate().to("url") command? Is there any difference between the two?

521


What are the advantages of rc?

526


To generate pdf reports mention what java api is required?

455


Is the firefoxdriver a class or an interface?

572






What difference do you make between soft vs. Hard to say in selenium?

486


what are the testing frameworks used in selenium?

520


How can you redirect browsing from a browser through some proxy?

1172


Is webelement an interface or a class?

563


What are the performance testing tools?

540


How is a statement different from verification?

489


What kind of mouse actions can be performed in selenium?

478


What kind of keyboard operations can be performed in selenium?

462


How you can switch between frames?

524


Mention what is the difference between implicit wait and explicit wait?

466