use of ru.sbtqa.tag.pagefactory.Page in project page-factory-2 by sbtqa.
the class WebStepsImpl method putElementValueInStash.
public T putElementValueInStash(String elementName, String variableName) throws PageException {
Page currentPage = PageContext.getCurrentPage();
WebElement element = Environment.getFindUtils().getElementByTitle(currentPage, elementName);
Stash.put(variableName, ElementUtils.getWebElementValue(element));
return (T) this;
}
use of ru.sbtqa.tag.pagefactory.Page in project page-factory-2 by sbtqa.
the class HtmlFindUtils method getField.
private Field getField(Object element, String elementName) {
Page page = PageContext.getCurrentPage();
Class clazz = element == null ? page.getClass() : element.getClass();
for (Field field : FieldUtilsExt.getFieldsListWithAnnotation(clazz, ElementTitle.class)) {
field.setAccessible(true);
if (field.getAnnotation(ElementTitle.class).value().equals(elementName)) {
return field;
}
}
return null;
}
Aggregations