use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.
the class CustomMethods method setTableCellsInputTypeString.
// Methods for filling the table for central
public void setTableCellsInputTypeString(WebDriver driver, String serviceName, String tableName, String cellName, String NameRow, String text) {
WebElement td = driver.findElement(By.cssSelector("#field-" + tableName + " input[name=" + cellName + NameRow + "]"));
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(td));
td.click();
td.clear();
td.sendKeys(text);
}
use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.
the class CustomMethods method SetRegionFieldInputTypeLong.
public void SetRegionFieldInputTypeLong(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 iTest by e-government-ua.
the class CustomMethods method click.
public void click(WebDriver driver, WebElement webElement) {
new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(webElement));
webElement.click();
}
use of org.openqa.selenium.support.ui.WebDriverWait in project iTest by e-government-ua.
the class CustomMethods method getText.
//public void attachDocument(WebElement locator, String document, WebDriver driver) {
//}
public String getText(WebDriver driver, WebElement webElement) throws Exception {
new WebDriverWait(driver, 5).until(ExpectedConditions.visibilityOf(webElement));
String answer = null;
try {
answer = webElement.getText();
} catch (Exception e) {
throw new Exception(e);
}
return answer;
}
use of org.openqa.selenium.support.ui.WebDriverWait in project nutch by apache.
the class DefaultClickAllAjaxLinksHandler method processDriver.
public String processDriver(WebDriver driver) {
String accumulatedData = "";
try {
driver.findElement(By.tagName("body")).getAttribute("innerHTML");
Configuration conf = NutchConfiguration.create();
new WebDriverWait(driver, conf.getLong("libselenium.page.load.delay", 3));
List<WebElement> atags = driver.findElements(By.tagName("a"));
int numberofajaxlinks = atags.size();
for (int i = 0; i < numberofajaxlinks; i++) {
if (atags.get(i).getAttribute("href") != null && atags.get(i).getAttribute("href").equals("javascript:void(null);")) {
atags.get(i).click();
if (i == numberofajaxlinks - 1) {
// append everything to the driver in the last round
JavascriptExecutor jsx = (JavascriptExecutor) driver;
jsx.executeScript("document.body.innerHTML=document.body.innerHTML " + accumulatedData + ";");
continue;
}
accumulatedData += driver.findElement(By.tagName("body")).getAttribute("innerHTML");
// refreshing the handlers as the page was interacted with
driver.navigate().refresh();
new WebDriverWait(driver, conf.getLong("libselenium.page.load.delay", 3));
atags = driver.findElements(By.tagName("a"));
}
}
} catch (Exception e) {
LOG.info(StringUtils.stringifyException(e));
}
return accumulatedData;
}
Aggregations