use of org.openqa.selenium.support.ui.WebDriverWait in project devonfw-testing by devonfw.
the class JavaScriptAlertsPage method clickAlertButton.
public void clickAlertButton() {
new Button(selectorAlertButton).click();
WebDriverWait wait = new WebDriverWait(getDriver(), 2);
wait.until(ExpectedConditions.alertIsPresent());
}
use of org.openqa.selenium.support.ui.WebDriverWait in project selenium_java by sergueik.
the class FirefoxTest method test.
@Test
public void test() {
// Your test code here. For example:
// 30 seconds of timeout
WebDriverWait wait = new WebDriverWait(driver, 30);
// navigate to
driver.get("https://en.wikipedia.org/wiki/Main_Page");
// Wikipedia
// search for "Software"
By searchInput = By.id("searchInput");
wait.until(ExpectedConditions.presenceOfElementLocated(searchInput));
driver.findElement(searchInput).sendKeys("Software");
By searchButton = By.id("searchButton");
wait.until(ExpectedConditions.elementToBeClickable(searchButton));
driver.findElement(searchButton).click();
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.tagName("body"), // assert that the resulting
"Computer software"));
// page contains a text
}
use of org.openqa.selenium.support.ui.WebDriverWait in project selenium_java by sergueik.
the class MultipleBrowsersTest method test.
@Test
public void test() {
// Your test code here. For example:
// 30 seconds of timeout
WebDriverWait wait = new WebDriverWait(driver, 30);
// navigate to Wikipedia
driver.get("https://en.wikipedia.org/wiki/Main_Page");
// search for "Software"
By searchInput = By.id("searchInput");
wait.until(ExpectedConditions.presenceOfElementLocated(searchInput));
driver.findElement(searchInput).sendKeys("Software");
By searchButton = By.id("searchButton");
wait.until(ExpectedConditions.elementToBeClickable(searchButton));
driver.findElement(searchButton).click();
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.tagName("body"), // assert that the resulting page contains a text
"Computer software"));
}
use of org.openqa.selenium.support.ui.WebDriverWait in project selenium_java by sergueik.
the class AppTest method setUp.
@BeforeClass
public static void setUp() throws Exception {
driver = new FirefoxDriver();
wait = new WebDriverWait(driver, flexible_wait_interval);
wait.pollingEvery(wait_polling_interval, TimeUnit.MILLISECONDS);
driver.manage().timeouts().implicitlyWait(implicit_wait_interval, TimeUnit.SECONDS);
actions = new Actions(driver);
}
use of org.openqa.selenium.support.ui.WebDriverWait in project selenium_java by sergueik.
the class ChromePagePerformanceUtil method getLoadTime.
public double getLoadTime(WebDriver driver, By navigator) {
WebDriverWait wait = new WebDriverWait(driver, flexibleWait);
wait.until(ExpectedConditions.presenceOfElementLocated(navigator)).click();
waitPageToLoad(driver, wait);
setTimer(driver);
return calculateLoadTime();
}
Aggregations