use of com.capgemini.ntc.selenium.core.exceptions.BFElementNotFoundException in project devonfw-testing by devonfw.
the class NewRemoteWebDriver method findElement.
/**
* @deprecated As of release 1.0.0, replaced by {@link #findElementDynamic(By)()}
*/
@Deprecated
@Override
public WebElement findElement(By by) throws BFElementNotFoundException {
BasePage.getAnalytics().sendMethodEvent(BasePage.analitycsCategoryName);
WebElement elementFromDriver = null;
try {
elementFromDriver = super.findElement(by);
} catch (NoSuchElementException e) {
throw new BFElementNotFoundException(by);
}
return new NewRemoteWebElement(elementFromDriver);
}
use of com.capgemini.ntc.selenium.core.exceptions.BFElementNotFoundException in project devonfw-testing by devonfw.
the class DriverExtention method waitUntilElementIsClickable.
public WebElement waitUntilElementIsClickable(final By by) {
BasePage.getAnalytics().sendMethodEvent(BasePage.analitycsCategoryName);
long startTime = System.currentTimeMillis();
WebElement element = null;
try {
element = webDriverWait().until(ExpectedConditions.elementToBeClickable(by));
} catch (TimeoutException | NoSuchElementException e) {
boolean isTimeout = true;
throw new BFElementNotFoundException(by, isTimeout, BasePage.EXPLICITYWAITTIMER);
}
BFLogger.logTime(startTime, "waitUntilElementIsClickable()", by.toString());
return element;
}
use of com.capgemini.ntc.selenium.core.exceptions.BFElementNotFoundException in project devonfw-testing by devonfw.
the class DriverExtention method waitForElementVisible.
public WebElement waitForElementVisible(final By by) throws BFElementNotFoundException {
BasePage.getAnalytics().sendMethodEvent(BasePage.analitycsCategoryName);
long startTime = System.currentTimeMillis();
WebElement element = null;
try {
element = webDriverWait().until(ExpectedConditions.visibilityOfElementLocated(by));
} catch (TimeoutException | NoSuchElementException e) {
boolean isTimeout = true;
throw new BFElementNotFoundException(by, isTimeout, BasePage.EXPLICITYWAITTIMER);
}
BFLogger.logTime(startTime, "waitForElementVisible()", by.toString());
return element;
}
use of com.capgemini.ntc.selenium.core.exceptions.BFElementNotFoundException in project devonfw-testing by devonfw.
the class DriverExtention method findElementsDynamic.
public List<WebElement> findElementsDynamic(By by, int timeOut) throws BFElementNotFoundException {
BasePage.getAnalytics().sendMethodEvent(BasePage.analitycsCategoryName);
long startTime = System.currentTimeMillis();
WebDriverWait wait = webDriverWait(timeOut);
List<WebElement> elements = new ArrayList<WebElement>();
try {
elements = wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(by));
} catch (BFElementNotFoundException | TimeoutException e) {
throw new BFElementNotFoundException(by, true, timeOut);
}
if (elements.isEmpty()) {
BFLogger.logError("Not found element : " + by.toString() + ".");
}
BFLogger.logTime(startTime, "findElementDynamics()", by.toString());
return elements;
}
use of com.capgemini.ntc.selenium.core.exceptions.BFElementNotFoundException in project devonfw-testing by devonfw.
the class DriverExtention method findElementDynamicBasic.
private WebElement findElementDynamicBasic(By by, long startTime, int timeOut) throws BFElementNotFoundException {
WebElement element = null;
WebDriverWait wait = webDriverWait(timeOut);
try {
element = wait.until(ExpectedConditions.presenceOfElementLocated(by));
} catch (TimeoutException | NoSuchElementException e) {
boolean isTimeout = true;
throw new BFElementNotFoundException(by, isTimeout, timeOut);
}
BFLogger.logTime(startTime, "findElementDynamic()", by.toString());
return element;
}
Aggregations