Search in sources :

Example 41 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.

the class CustomMethods method setTableCellsTypeCalendar.

public void setTableCellsTypeCalendar(WebDriver driver, String serviceName, String tableName, String cellName, String NameRow, String date) {
    WebElement td = driver.findElement(By.cssSelector("#field-" + tableName + " input[name=" + cellName + NameRow + "]"));
    new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(td));
    ((JavascriptExecutor) driver).executeScript("angular.element(document.getElementsByName('" + cellName + NameRow + "')[0]).removeAttr('readonly');");
    td.click();
    td.clear();
    td.sendKeys(date);
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait)

Example 42 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.

the class CustomMethods method SetRegionFieldInputTypeDate.

public void SetRegionFieldInputTypeDate(WebDriver driver, String serviceName, String cssSelector, String date) {
    WebElement webElement = driver.findElement(By.cssSelector("input[name='" + 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(date);
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait)

Example 43 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.

the class CustomMethods method clickButtonEcp.

public void clickButtonEcp() {
    WebElement element = driver.findElement(By.xpath("//button[contains(@onclick,'startClientSign()')]"));
    new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(element));
    element.sendKeys("src/test/resources/files/Key-6.dat");
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait)

Example 44 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.

the class CustomMethods method waitForElementPresent.

public void waitForElementPresent(WebDriver driver, WebElement webElement, int timeoutInSeconds, int pollingInterval) throws Exception {
    WebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds, pollingInterval);
    wait.until(ExpectedConditions.visibilityOf(webElement));
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait)

Example 45 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.

the class CustomMethods method assertThis.

public void assertThis(WebDriver driver, WebElement webElement, String textAssert) {
    new WebDriverWait(driver, 30).until(ExpectedConditions.visibilityOf(webElement));
    Assert.assertEquals(webElement.getText(), textAssert);
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait)

Aggregations

WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)556 WebElement (org.openqa.selenium.WebElement)173 WebDriver (org.openqa.selenium.WebDriver)139 Test (org.junit.Test)88 By (org.openqa.selenium.By)58 Actions (org.openqa.selenium.interactions.Actions)54 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)47 TimeoutException (org.openqa.selenium.TimeoutException)41 ExpectedCondition (org.openqa.selenium.support.ui.ExpectedCondition)38 IOException (java.io.IOException)30 List (java.util.List)27 Wait (org.openqa.selenium.support.ui.Wait)25 BeforeClass (org.junit.BeforeClass)24 NgWebDriver (com.github.sergueik.jprotractor.NgWebDriver)21 ArrayList (java.util.ArrayList)21 WebDriverException (org.openqa.selenium.WebDriverException)21 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)21 Dimension (org.openqa.selenium.Dimension)20 File (java.io.File)18 NoSuchElementException (org.openqa.selenium.NoSuchElementException)16