use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.
the class TemplatePage method mokAuthorization.
/**
* ********************** Методы авторизации *************************
*/
public void mokAuthorization() {
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(buttonAuthMock));
//выбираем Off AuthMock/BankID
if (spanAuthMock.getText().equalsIgnoreCase("On AuthMock")) {
cm.click(driver, buttonAuthMock);
}
cm.click(driver, buttonBankID);
cm.clickXpath(driver, "//li[1]/a//span[contains(.,'ПриватБанк')]");
}
use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.
the class CustomMethods method SetRegionFieldInputTypeCheckbox.
public void SetRegionFieldInputTypeCheckbox(WebDriver driver, String serviceName, String cssSelector) {
// //*[@id="bFavorite11"] //*[@id="field-bWrite"]/div
WebElement checkbox = driver.findElement(By.cssSelector("#" + cssSelector));
new WebDriverWait(driver, 10).until(ExpectedConditions.elementToBeClickable(checkbox));
checkbox.click();
checkbox.click();
}
use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.
the class CustomMethods method setFieldCalendar.
public void setFieldCalendar(WebDriver driver, String serviceName, String cssSelector, String data) {
WebElement webElement = driver.findElement(By.cssSelector("." + serviceName + "_--_" + cssSelector));
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(webElement));
((JavascriptExecutor) driver).executeScript("angular.element(document.getElementsByName('" + cssSelector + "')[0]).removeAttr('readonly');");
webElement.click();
webElement.clear();
webElement.sendKeys(data);
}
use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.
the class CustomMethods method SetRegionFieldInputTypeString.
// Methods for filling the fields for central
public void SetRegionFieldInputTypeString(WebDriver driver, String serviceName, String cssSelector, String value) {
WebElement webElement = driver.findElement(By.cssSelector("input[name='" + cssSelector + "']"));
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(webElement));
// webElement.click();
webElement.clear();
webElement.sendKeys(value);
}
use of org.openqa.selenium.support.ui.WebDriverWait in project opennms by OpenNMS.
the class BSMAdminIT method verifyElementNotPresent.
/**
* Verifies that the provided element is not present.
* @param by
*/
private static void verifyElementNotPresent(OpenNMSSeleniumTestCase testCase, final By by) {
new WebDriverWait(testCase.getDriver(), 5).until(ExpectedConditions.not(new ExpectedCondition<Boolean>() {
@Nullable
@Override
public Boolean apply(@Nullable WebDriver input) {
try {
// the default implicit wait timeout is too long, make it shorter
input.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
WebElement elementFound = input.findElement(by);
return elementFound != null;
} catch (NoSuchElementException ex) {
return false;
} finally {
// set the implicit wait timeout back to the value it has been before
input.manage().timeouts().implicitlyWait(LOAD_TIMEOUT, TimeUnit.MILLISECONDS);
}
}
}));
}
Aggregations