use of org.openqa.selenium.support.ui.WebDriverWait in project cerberus-source by cerberustesting.
the class WebDriverService method isElementNotPresent.
@Override
public boolean isElementNotPresent(Session session, Identifier identifier) {
By locator = this.getBy(identifier);
LOG.debug("Waiting for Element to be not present : " + identifier.getIdentifier() + "=" + identifier.getLocator());
try {
WebDriverWait wait = new WebDriverWait(session.getDriver(), TimeUnit.MILLISECONDS.toSeconds(session.getCerberus_selenium_wait_element()));
return wait.until(ExpectedConditions.not(ExpectedConditions.presenceOfElementLocated(locator)));
} catch (TimeoutException exception) {
LOG.warn("Exception waiting for element to be not present :" + exception);
return false;
}
}
use of org.openqa.selenium.support.ui.WebDriverWait in project cerberus-source by cerberustesting.
the class WebDriverService method isElementNotVisible.
@Override
public boolean isElementNotVisible(Session session, Identifier identifier) {
By locator = this.getBy(identifier);
LOG.debug("Waiting for Element to be not visible : " + identifier.getIdentifier() + "=" + identifier.getLocator());
try {
WebDriverWait wait = new WebDriverWait(session.getDriver(), TimeUnit.MILLISECONDS.toSeconds(session.getCerberus_selenium_wait_element()));
return wait.until(ExpectedConditions.invisibilityOfElementLocated(locator));
} catch (TimeoutException exception) {
LOG.warn("Exception waiting for element to be not visible :" + exception);
return false;
}
}
use of org.openqa.selenium.support.ui.WebDriverWait in project devonfw-testing by devonfw.
the class GmailSignInPage method clickNextButton.
/**
* Performs left mouse button click on 'Next' button element.
*
* @return new GmailWelcomePage object.
*/
public GmailWelcomePage clickNextButton() {
getDriver().elementButton(selectorNextButton).click();
WebDriverWait wait = new WebDriverWait(getDriver(), 2);
wait.until(ExpectedConditions.urlContains("pwd"));
return new GmailWelcomePage();
}
use of org.openqa.selenium.support.ui.WebDriverWait in project devonfw-testing by devonfw.
the class GmailWelcomePage method clickNextButton.
/**
* Performs left mouse button click on 'Next' button element.
*
* @return new GmailInboxPage object.
*/
public GmailInboxPage clickNextButton() {
getDriver().elementButton(selectorNextButton).click();
WebDriverWait wait = new WebDriverWait(getDriver(), 10);
wait.until(ExpectedConditions.urlContains("#inbox"));
return new GmailInboxPage();
}
use of org.openqa.selenium.support.ui.WebDriverWait in project devonfw-testing by devonfw.
the class DynamicLoadingPage method getExampleTwoDynamicText.
/**
* Returns example text.
* <p>
* Waits until WebElement representing waiting bar disappear. Then waits until example text will show up.
* And after that returns example text.
* </p>
*
* @param waitTime
* The amount of time designated for waiting until waiting bar disappears and example text shows.
* @return String representing example's text.
*/
public String getExampleTwoDynamicText(int waitTime) {
WebDriverWait wait = new WebDriverWait(getDriver(), waitTime);
wait.until(ExpectedConditions.invisibilityOf(getDriver().findElementDynamic(selectorLoadingBar)));
wait.until(ExpectedConditions.visibilityOf(getDriver().findElementDynamic(selectorExampleText)));
return getDriver().findElementDynamic(selectorExampleText).getText();
}
Aggregations