ImplicitlyWait
driver.manage().timeouts().implicitlyWait(45, TimeUnit.SECONDS);
ExplicitWait
WebElement oneWayRadioButton = wait.until(ExpectedConditions.elementToBeClickable(By.id(YOUR_Locator)));
oneWayRadioButton.click();
pageLoadTimeout
driver.manage().timeouts().pageLoadTimeout(100, TimeUnit.SECONDS);
setScriptTimeout
driver.manage().timeouts().setScriptTimeout(100, TimeUnit.SECONDS);
You need to call ignoring with exception to ignore while the WebDriver will wait.
// Waiting 30 seconds for an element to be present on the page, checking // for its presence once every 5 seconds.
try{
WaitWebDriver wait = new FluentWaitWebDriver(driver)
.withTimeout(30, SECONDS)
.pollingEvery(5, SECONDS)
}catch(NoSuchElementException ignore) {}
WebElement foo = wait.until(new FunctionWebDriver, WebElement() {
public WebElement apply(WebDriver driver) {
return driver.findElement(By.id(YOUR_Locator));
}
});
You may even use
Thread.sleep(timeoutsec*1000);
However using Thread.sleep is not the best practices