use of ru.sbtqa.tag.pagefactory.find.HtmlFindUtils in project page-factory-2 by sbtqa.
the class ContactPage method findWebElement.
@ActionTitle("check find web element")
public void findWebElement() {
HtmlFindUtils htmlFindUtils = Environment.getFindUtils();
WebElement webElement = htmlFindUtils.find("send", WebElement.class);
Assert.assertFalse("Incorrect type", webElement.getClass().isAssignableFrom(TypifiedElement.class));
checkType(htmlFindUtils.find("send", Button.class), Button.class);
}
use of ru.sbtqa.tag.pagefactory.find.HtmlFindUtils in project page-factory-2 by sbtqa.
the class ContactPage method findTypifiedElement.
@ActionTitle("check find typified element")
public void findTypifiedElement() {
HtmlFindUtils htmlFindUtils = Environment.getFindUtils();
checkType(htmlFindUtils.find("first name", TypifiedElement.class), TextInput.class);
checkType(htmlFindUtils.find("first name", TextInput.class), TextInput.class);
checkType(htmlFindUtils.find("first name", WebElement.class), TextInput.class);
}
use of ru.sbtqa.tag.pagefactory.find.HtmlFindUtils in project page-factory-2 by sbtqa.
the class HtmlReflection method executeMethodByTitleInBlock.
/**
* Execute method with one or more parameters inside of the given block
* element
*
* @param blockPath block title, or a block chain string separated with
* {@code ->} symbols
* @param actionTitle title of the action to execute
* @param parameters parameters that will be passed to method
*/
public void executeMethodByTitleInBlock(String blockPath, String actionTitle, Object... parameters) {
try {
HtmlElement block = ((HtmlFindUtils) Environment.getFindUtils()).find(blockPath, HtmlElement.class);
executeMethodByTitle(block, actionTitle, parameters);
} catch (ElementSearchError ex) {
throw new ElementSearchError(format("Block not found by path '%s'", blockPath), ex);
}
}
Aggregations