Search in sources :

Example 46 with WebDriverWait

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

the class CustomMethods method setTableCellsSelectUp.

public void setTableCellsSelectUp(WebDriver driver, String serviceName, String cssSelector) {
    WebElement td = driver.findElement(By.cssSelector(cssSelector));
    new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(td));
    //        td.click();
    Select select = new Select(td);
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) Select(org.openqa.selenium.support.ui.Select)

Example 47 with WebDriverWait

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

the class CustomMethods method setTableCellsInputTypeEnum.

public void setTableCellsInputTypeEnum(WebDriver driver, String serviceName, String tableName, String cellName, String NameRow, String text) {
    //        WebElement td = driver.findElement(By.cssSelector("#field-"+tableName+" option[value=\""+value+"\"]"));
    WebElement td = driver.findElement(By.cssSelector("#field-" + tableName + " select[name=" + cellName + NameRow + "]"));
    new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(td));
    td.click();
    Select select = new Select(td);
    select.selectByVisibleText(text);
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) Select(org.openqa.selenium.support.ui.Select)

Example 48 with WebDriverWait

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

the class CustomMethods method setRegionTableCellsInputTypeCalendar.

public void setRegionTableCellsInputTypeCalendar(WebDriver driver, String serviceName, String tableName, String cellName, String NameRow, String date) {
    WebElement td = driver.findElement(By.cssSelector(".ng-scope." + serviceName + "_--_" + tableName + "_--_COL_" + cellName + "_--_ROW_" + NameRow + " input"));
    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 49 with WebDriverWait

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

the class CustomMethods method setFieldfieldPhone.

public void setFieldfieldPhone(WebDriver driver, String serviceName, String cssSelector, String value) {
    WebElement webElement = driver.findElement(By.cssSelector(".form-control.ng-pristine.ng-untouched.ng-scope.ng-invalid.ng-invalid-tel.ng-valid-required." + serviceName + "_--_" + cssSelector));
    new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(webElement));
    webElement.click();
    webElement.clear();
    webElement.sendKeys(value);
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait)

Example 50 with WebDriverWait

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

the class CustomMethods method SetRegionFieldInputTypeDouble.

public void SetRegionFieldInputTypeDouble(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);
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait)

Aggregations

WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)527 WebElement (org.openqa.selenium.WebElement)166 WebDriver (org.openqa.selenium.WebDriver)131 Test (org.junit.Test)86 By (org.openqa.selenium.By)54 Actions (org.openqa.selenium.interactions.Actions)53 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)43 TimeoutException (org.openqa.selenium.TimeoutException)38 ExpectedCondition (org.openqa.selenium.support.ui.ExpectedCondition)36 IOException (java.io.IOException)28 List (java.util.List)26 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)16 NoSuchElementException (org.openqa.selenium.NoSuchElementException)16