private boolean findRowByCriteria(JTableFixture tFixture, TableCommandRequest tcommand, int i, int totalFound) { for(TableCommandRequestQueryCriteria criterion: tcommand.query.criteria){ JTableCellFixture cell = tFixture.cell(TableCellByColumnId.row(i).columnId(criterion.lookupCol)); if (cell.value().equals(criterion.lookupValue)) { totalFound++; } if(totalFound == tcommand.query.criteria.size()){ return true; } } return false; }
/** * Right click on table cell * * @param row the row number * @param column the column number * @throws VerificationException if the table element doesn't exist */ @PublicAtsApi public void rightClickCell( int row, int column ) { new SwingElementState(this).waitToBecomeExisting(); JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this); try { tableFixture.cell(new TableCell(row, column) {}).rightClick(); } catch (Exception e) { throw new UiElementException(e.getMessage(), this); } }
/** * Double click table cell * * @param row the row number * @param column the column number * @throws VerificationException if the element doesn't exist */ @PublicAtsApi public void doubleClickCell( int row, int column ) { new SwingElementState(this).waitToBecomeExisting(); JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this); try { tableFixture.cell(new TableCell(row, column) {}).doubleClick(); } catch (Exception e) { throw new UiElementException(e.getMessage(), this); } }
/** * Click table cell * * @param row the row number * @param column the column number * @throws VerificationException if the table element doesn't exist */ @PublicAtsApi public void clickCell( int row, int column ) { new SwingElementState(this).waitToBecomeExisting(); JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this); try { tableFixture.cell(new TableCell(row, column) {}).click(); } catch (Exception e) { throw new UiElementException(e.getMessage(), this); } }
TableCommandRequest tcommand = (TableCommandRequest) command; for (int i = 0; i < tFixture.rowCount(); i++) { JTableCellFixture cell = tFixture.cell(TableCellByColumnId.row(i).columnId(tcommand.query.lookupCol)); if (cell.value().equals(command.value)) { JTableCellFixture cell2 = tFixture.cell(TableCellByColumnId.row(i).columnId(tcommand.query.resultCol)); String value = cell2.value(); cell2.select(); tcommand = (TableCommandRequest) command; for (int i = 0; i < tFixture.rowCount(); i++) { JTableCellFixture cell = tFixture.cell(TableCellByColumnId.row(i).columnId(tcommand.query.lookupCol)); if (cell.value().equals(command.value)) { cell.select(); tcommand = (TableCommandRequest) command; for (int i = 0; i < tFixture.rowCount(); i++) { JTableCellFixture cell = tFixture.cell(TableCellByColumnId.row(i).columnId(tcommand.query.lookupCol)); if (cell.value().equals(tcommand.query.lookupValue)) { try {
if(found){ if(tcommand.query.resultCol != null){ JTableCellFixture cell = tFixture.cell(TableCellByColumnId.row(i).columnId(tcommand.query.resultCol)); cell.select(); return cell.value(); boolean found = findRowByCriteria(tFixture, tcommand, i, totalFound); if(found){ JTableCellFixture cell = tFixture.cell(TableCell.row(i).column(1)); cell.select(); cell.doubleClick(); boolean found = findRowByCriteria(tFixture, tcommand, i, totalFound); if(found){ JTableCellFixture cell = tFixture.cell(TableCell.row(i).column(1)); try { cell.select();