Class SwingTable
- java.lang.Object
-
- com.axway.ats.uiengine.elements.UiElement
-
- com.axway.ats.uiengine.elements.UiTable
-
- com.axway.ats.uiengine.elements.swing.SwingTable
-
public class SwingTable extends UiTable
A Swing TableCan be identified by:
- name
- label
-
-
Field Summary
-
Fields inherited from class com.axway.ats.uiengine.elements.UiElement
log, properties
-
-
Constructor Summary
Constructors Constructor Description SwingTable(UiDriver uiDriver, UiElementProperties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclickCell(int row, int column)Click table cellvoidclickHeader(int columnIndex)Click table header by column indexvoidclickHeader(String columnName)Click table header by column namevoiddoubleClickCell(int row, int column)Double click table cellvoiddrag(int row, int column)Simulates a user dragging a cell from this tablevoiddrop(int row, int column)Simulates a user dropping an item into a specific table cellColorgetCellBackgroundColor(int row, int column)Returns the table cell backgroundColorColor[][]getCellBackgroundColors()Gets table cell backgrounds (asColor) of all table cells.ColorgetCellForegroundColor(int row, int column)Returns the table cell foregroundColorList<Integer[]>getCellIndexesByValue(String value, boolean isRegEx)Get table cell coordinates by cell valueintgetColumnCount()Get table column countStringgetFieldValue(int row, int column)Get table field valueintgetRowCount()Get table row countint[]getSelectedRows()Get selected rows in the tablevoidrightClickCell(int row, int column)Right click on table cellvoidselectCell(int row, int column)Select table cellvoidselectCells(int[][] cells)Select table cellsvoidselectRow(int... rows)Select table rowsvoidsetFieldValue(String value, int row, int column)Set table field valuevoidverifyFieldValue(String expectedValue, int row, int column)Verify the field value is as specifiedvoidverifyFieldValueRegex(String expectedValueRegex, int row, int column)Verify the field value matches the specified java regular expressionvoidverifyNotFieldValue(String notExpectedValue, int row, int column)Verify the field value is NOT as specified-
Methods inherited from class com.axway.ats.uiengine.elements.UiElement
checkTypeAndRules, getElementProperties, getElementProperty, getPropertyNamesToUseForMatch, getUiDriver, logAction, toString
-
-
-
-
Constructor Detail
-
SwingTable
public SwingTable(UiDriver uiDriver, UiElementProperties properties)
-
-
Method Detail
-
setFieldValue
public void setFieldValue(String value, int row, int column)
Set table field value- Specified by:
setFieldValuein classUiTable- Parameters:
value- the value to setrow- the row numbercolumn- the column number- Throws:
VerificationException- if the element doesn't exist
-
getFieldValue
public String getFieldValue(int row, int column)
Get table field value- Specified by:
getFieldValuein classUiTable- Parameters:
row- the row numbercolumn- the column number- Returns:
- Throws:
VerificationException- if the element doesn't exist
-
getRowCount
public int getRowCount()
Get table row count- Specified by:
getRowCountin classUiTable- Returns:
- how many rows this table has
- Throws:
VerificationException- if the table element doesn't exist
-
getColumnCount
public int getColumnCount()
Get table column count- Specified by:
getColumnCountin classUiTable- Returns:
- how many columns this table has
- Throws:
VerificationException- if the table element doesn't exist
-
verifyFieldValue
public void verifyFieldValue(String expectedValue, int row, int column)
Verify the field value is as specified- Specified by:
verifyFieldValuein classUiTable- Parameters:
expectedValue-row- the field row starting at 0column- the field column starting at 0- Throws:
VerificationException- if the element doesn't existVerifyEqualityException- if the verification fails
-
verifyNotFieldValue
public void verifyNotFieldValue(String notExpectedValue, int row, int column)
Verify the field value is NOT as specified- Specified by:
verifyNotFieldValuein classUiTable- Parameters:
notExpectedValue-row- the field row starting at 0column- the field column starting at 0- Throws:
VerificationException- if the element doesn't existVerifyNotEqualityException- if the verification fails
-
verifyFieldValueRegex
public void verifyFieldValueRegex(String expectedValueRegex, int row, int column)
Verify the field value matches the specified java regular expression- Specified by:
verifyFieldValueRegexin classUiTable- Parameters:
expectedValueRegex- a java regular expressionrow- the field row starting at 0column- the field column starting at 0- Throws:
VerificationException- if the element doesn't existVerifyEqualityException- if the verification fails
-
clickCell
public void clickCell(int row, int column)Click table cell- Parameters:
row- the row numbercolumn- the column number- Throws:
VerificationException- if the table element doesn't exist
-
doubleClickCell
public void doubleClickCell(int row, int column)Double click table cell- Parameters:
row- the row numbercolumn- the column number- Throws:
VerificationException- if the element doesn't exist
-
rightClickCell
public void rightClickCell(int row, int column)Right click on table cell- Parameters:
row- the row numbercolumn- the column number- Throws:
VerificationException- if the table element doesn't exist
-
getCellIndexesByValue
public List<Integer[]> getCellIndexesByValue(String value, boolean isRegEx)
Get table cell coordinates by cell value- Parameters:
value- cell value to search forisRegEx- if the value is a regular expression- Returns:
- an
ArrayListwith cell coordinates(indexes) represented by arrays [ row, column ] which contains the searched value - Throws:
VerificationException- if the table element doesn't exist
-
selectCell
public void selectCell(int row, int column)Select table cell- Parameters:
row- the row numbercolumn- the column number- Throws:
VerificationException- if the table element doesn't exist
-
selectCells
public void selectCells(int[][] cells)
Select table cells- Parameters:
cells- the cells coordinates (eg. new int[][]{ { 1, 1 }, { 1, 2 }, { 2, 2 } )- Throws:
VerificationException- if the element doesn't exist
-
selectRow
public void selectRow(int... rows)
Select table rows- Parameters:
rows- row numbers to select- Throws:
VerificationException- if the element doesn't exist
-
getSelectedRows
public int[] getSelectedRows()
Get selected rows in the table- Returns:
- an array with the selected rows
- Throws:
VerificationException- if the table element doesn't exist
-
clickHeader
public void clickHeader(int columnIndex)
Click table header by column index- Parameters:
columnIndex- the column index- Throws:
VerificationException- if the table element doesn't exist
-
clickHeader
public void clickHeader(String columnName)
Click table header by column name- Parameters:
columnName- the column name- Throws:
VerificationException- if the table element doesn't exist
-
drag
public void drag(int row, int column)Simulates a user dragging a cell from this table- Parameters:
row- the row numbercolumn- the column number
-
drop
public void drop(int row, int column)Simulates a user dropping an item into a specific table cell- Parameters:
row- the row numbercolumn- the column number
-
getCellBackgroundColor
public Color getCellBackgroundColor(int row, int column)
Returns the table cell backgroundColor- Parameters:
row- the row numbercolumn- the column number
-
getCellBackgroundColors
public Color[][] getCellBackgroundColors()
Gets table cell backgrounds (asColor) of all table cells.- Returns:
- array of java.awt.Color objects one for each cell. First index is table row and second is the column in this row.
-
-