use of com.qaprosoft.carina.core.foundation.utils.metadata.model.Rect in project carina by qaprosoft.
the class ExtendedWebElement method getElementInfo.
@SuppressWarnings("unchecked")
private ElementInfo getElementInfo(ExtendedWebElement extendedWebElement) {
ElementInfo elementInfo = new ElementInfo();
if (extendedWebElement.isElementPresent(1)) {
Point location = extendedWebElement.getElement().getLocation();
Dimension size = extendedWebElement.getElement().getSize();
elementInfo.setRect(new Rect(location.getX(), location.getY(), size.getWidth(), size.getHeight()));
elementInfo.setElementsAttributes((Map<String, String>) ((RemoteWebDriver) driver).executeScript(ATTRIBUTE_JS, extendedWebElement.getElement()));
try {
elementInfo.setText(extendedWebElement.getText());
} catch (Exception e) {
elementInfo.setText("");
}
return elementInfo;
} else {
return null;
}
}
Aggregations