1. Implicit wait:
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
2. Javascript wait for the element ready state
((JavascriptExecutor)driver).executeScript("return document.readyState").equals("complete");
3. Thread.sleep(6000) // this will work irrespective of the page load.
4. WebElement element = (new WebDriverWait(getDriver(), 30)).until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input#name")));
//This will through exception if the element is not found
My application is build in angular js, Please suggest me which is the best approach to follow handling synchronisation.
Thanks
You can make a custom function customWait()
and call it
public void customWait(String time){
Thread.sleep(time);
}