use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTable method doubleClickCell.
/**
* 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);
}
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTable method setFieldValue.
/**
* Set table field value
*
* @param value the value to set
* @param row the row number
* @param column the column number
* @throws VerificationException if the element doesn't exist
*/
@Override
@PublicAtsApi
public void setFieldValue(String value, int row, int column) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
TableCell tableCell = new TableCell(row, column) {
};
// if the cell coordinates are wrong, the exception will be thrown
tableFixture.selectCell(tableCell);
if (tableFixture.component().isCellEditable(row, column)) {
tableFixture.enterValue(tableCell, value);
} else {
throw new NotSupportedOperationException("The table cell [" + row + "," + column + "] is not editable. " + toString());
}
} catch (IndexOutOfBoundsException ioobe) {
throw new UiElementException(ioobe.getMessage(), this);
}
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTable method clickHeader.
/**
* Click table header by column name
*
* @param columnName the column name
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void clickHeader(String columnName) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
JTableHeaderFixture tableHeaderFixture = tableFixture.tableHeader();
try {
tableHeaderFixture.clickColumn(columnName);
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingTable method selectCells.
/**
* Select table cells
*
* @param cells the cells coordinates (eg. new int[][]{ { 1, 1 }, { 1, 2 }, { 2, 2 } )
* @throws VerificationException if the element doesn't exist
*/
@PublicAtsApi
public void selectCells(int[][] cells) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
TableCell[] cellsToSelect = new TableCell[cells.length];
for (int i = 0; i < cells.length; i++) {
int row = cells[i][0];
int column = cells[i][1];
cellsToSelect[i] = new TableCell(row, column) {
};
}
tableFixture.selectCells(cellsToSelect);
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
use of com.axway.ats.common.PublicAtsApi in project ats-framework by Axway.
the class SwingSpinner method clickNext.
/**
* Click next/increment spinner button
* @param times number of times to click. Must be greater than 0
* @throws VerificationException if the element doesn't exist
*/
@PublicAtsApi
public void clickNext(int times) {
if (times <= 0) {
throw new UiElementException("The number of times to click must be greater than 0", this);
}
new SwingElementState(this).waitToBecomeExisting();
((JSpinnerFixture) SwingElementLocator.findFixture(this)).increment(times);
}
Aggregations