use of ru.sbtqa.tag.pagefactory.exception.TableNotContainTextError in project page-factory-2 by sbtqa.
the class TableAbstract method getRowAsCells.
private WebElement getRowAsCells(WebElement context, int columnIndex, String cellText) {
String searchFragment = getSearchFragment(cellText, SearchStrategy.EQUALS);
List<WebElement> cells = context.findElements(By.xpath(getColumnXpath(columnIndex) + searchFragment));
try {
WebElement cell = ElementUtils.getElementByIndex(cells, 0);
if (isSimpleCell(cell)) {
LOG.warn("Cell text is complex. A match was found among one of the cell elements");
}
return cell;
} catch (ElementNotFoundException ex) {
throw new TableNotContainTextError(cellText);
}
}
use of ru.sbtqa.tag.pagefactory.exception.TableNotContainTextError in project page-factory-2 by sbtqa.
the class TableAbstract method selectRow.
private void selectRow(WebElement context, String cellText, SearchStrategy searchStrategy, int serialNumber, boolean doubleClick) {
String searchFragment = getSearchFragment(cellText, searchStrategy);
List<WebElement> cells = context.findElements(By.xpath(getColumnsXpath() + searchFragment));
try {
WebElement cell = ElementUtils.getElementByIndex(cells, serialNumber - 1);
if (isSimpleCell(cell)) {
LOG.warn("Cell text is complex. A match was found among one of the cell elements");
}
click(cell, doubleClick);
} catch (ElementNotFoundException ex) {
throw new TableNotContainTextError(cellText);
}
}
Aggregations