use of com.axway.ats.uiengine.AbstractRealBrowserDriver in project ats-framework by Axway.
the class RealHtmlElementLocator method findElements.
public static List<WebElement> findElements(UiElement uiElement, String xpathSuffix, boolean verbose) {
AbstractRealBrowserDriver browserDriver = (AbstractRealBrowserDriver) uiElement.getUiDriver();
WebDriver webDriver = (WebDriver) browserDriver.getInternalObject(InternalObjectsEnum.WebDriver.name());
HtmlNavigator.getInstance().navigateToFrame(webDriver, uiElement);
String xpath = uiElement.getElementProperties().getInternalProperty(HtmlElementLocatorBuilder.PROPERTY_ELEMENT_LOCATOR);
String css = uiElement.getElementProperty("_css");
if (xpathSuffix != null) {
xpath += xpathSuffix;
}
if (!StringUtils.isNullOrEmpty(css)) {
return webDriver.findElements(By.cssSelector(css));
} else {
return webDriver.findElements(By.xpath(xpath));
}
}
use of com.axway.ats.uiengine.AbstractRealBrowserDriver in project ats-framework by Axway.
the class RealHtmlButton method doClick.
private void doClick() {
try {
new RealHtmlElementState(this).waitToBecomeExisting();
WebElement element = RealHtmlElementLocator.findElement(this);
try {
element.click();
} catch (ElementNotVisibleException enve) {
if (!UiEngineConfigurator.getInstance().isWorkWithInvisibleElements()) {
throw enve;
}
((JavascriptExecutor) webDriver).executeScript("arguments[0].click()", element);
}
} catch (Exception e) {
((AbstractRealBrowserDriver) super.getUiDriver()).clearExpectedPopups();
throw new SeleniumOperationException(this, "click", e);
}
UiEngineUtilities.sleep();
((AbstractRealBrowserDriver) super.getUiDriver()).handleExpectedPopups();
}
Aggregations