use of com.capgemini.ntc.selenium.core.exceptions.BFElementNotFoundException in project devonfw-testing by devonfw.
the class DriverExtention method waitForPageLoaded.
public void waitForPageLoaded() throws BFElementNotFoundException {
long startTime = System.currentTimeMillis();
final String jsVariable = "return document.readyState";
ExpectedCondition<Boolean> expectation = new ExpectedCondition<Boolean>() {
public Boolean apply(WebDriver driver) {
return ((JavascriptExecutor) driver).executeScript(jsVariable).equals("complete");
}
};
int progressBarWaitTimer = BasePage.PROGRESSBARWAITTIMER;
WebDriverWait wait = webDriverWait(progressBarWaitTimer);
try {
wait.until(expectation);
} catch (TimeoutException | NoSuchElementException e) {
boolean isTimeout = true;
throw new BFElementNotFoundException(By.cssSelector(jsVariable), isTimeout, progressBarWaitTimer);
}
BFLogger.logTime(startTime, "waitForPageLoaded");
}
use of com.capgemini.ntc.selenium.core.exceptions.BFElementNotFoundException in project devonfw-testing by devonfw.
the class NewChromeDriver method findElement.
/**
* @deprecated As of release 1.0.0, replaced by {@link #findElementDynamic(By)()}
*/
@Deprecated
@Override
public WebElement findElement(By by) throws BFElementNotFoundException {
BaseTest.getAnalytics().sendMethodEvent(BasePage.analitycsCategoryName);
WebElement elementFromDriver = null;
try {
elementFromDriver = super.findElement(by);
} catch (NoSuchElementException e) {
throw new BFElementNotFoundException(by);
}
return new NewRemoteWebElement(elementFromDriver);
}
Aggregations