Class DataGridValidatorSI
- java.lang.Object
-
- org.uitnet.testing.smartfwk.ui.standard.imgobj.datagrid.DataGridValidatorSI
-
public class DataGridValidatorSI extends Object
- Author:
- Madhav Krishna
-
-
Field Summary
Fields Modifier and Type Field Description protected SmartAppDriverappDriverprotected DataGridSIdataGridprotected org.slf4j.Loggerloggerprotected org.sikuli.script.Regionregion
-
Constructor Summary
Constructors Constructor Description DataGridValidatorSI(SmartAppDriver appDriver, DataGridSI locator, org.sikuli.script.Region region)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<List<String>>extractRecordsForVisibleColumns(int numRecords, ItemList<HeaderColumnSI> headerColumns, VerticalScrollbar vScrollbar, org.sikuli.script.Region vScrollbarRegion, int numHops, int numHopIters)It extracts the records from the datagrid only for the visible columns.List<List<String>>extractVisibleRecordsForVisibleColumns(ItemList<HeaderColumnSI> headerColumns)It extracts the visible records data only for the visible header columns on the screen.protected Set<Integer>findRowMarkerY1()org.sikuli.script.RegiongetCellRegion(HeaderColumnSI headerColumn, RowLocation rowLocation, HorizontalScrollbar hScrollbar, int scrollStepsToLookup)Cell is identified by header column location in row location.DataGridSIgetUIObject()voidinitializeDataGrid(int maxIterationsToLocateElements)It initializes the datagrid location on the screen.protected voidinitializeDataGridHeader(int maxIterationsToLocateElements)protected booleanisHScrollingRequired()booleanisPresent(int maxIterationsToLocateElements)RowLocationisRecordPresent(ItemList<SearchCell> primaryKey)RowLocationisRecordPresent(ItemList<SearchCell> primaryKey, VerticalScrollbar vScrollbar, org.sikuli.script.Region vScrollbarRegion, int numHops, int numHopIters)This method searches the record from top to bottom.voidvalidateCellValuePresent(SearchCell cellValue, RowLocation rowLocation, HorizontalScrollbar hScrollbar, int scrollStepsToLookup)voidvalidateRecordPresent(ItemList<SearchCell> primaryKey)
-
-
-
Field Detail
-
logger
protected org.slf4j.Logger logger
-
appDriver
protected SmartAppDriver appDriver
-
dataGrid
protected DataGridSI dataGrid
-
region
protected org.sikuli.script.Region region
-
-
Constructor Detail
-
DataGridValidatorSI
public DataGridValidatorSI(SmartAppDriver appDriver, DataGridSI locator, org.sikuli.script.Region region)
-
-
Method Detail
-
getUIObject
public DataGridSI getUIObject()
-
initializeDataGridHeader
protected void initializeDataGridHeader(int maxIterationsToLocateElements)
-
initializeDataGrid
public void initializeDataGrid(int maxIterationsToLocateElements)
It initializes the datagrid location on the screen. It also initializes the data grid record area.- Parameters:
maxIterationsToLocateElements-
-
isHScrollingRequired
protected boolean isHScrollingRequired()
-
isRecordPresent
public RowLocation isRecordPresent(ItemList<SearchCell> primaryKey, VerticalScrollbar vScrollbar, org.sikuli.script.Region vScrollbarRegion, int numHops, int numHopIters)
This method searches the record from top to bottom.- Parameters:
primaryKey- record to be searched in data grid using vertical scrolling.vScrollbar- vertical scrollbar used to navigate the records in the data grid.vScrollbarRegion- region where the scrollbar presentnumHops- how many hops/clicks it should perform per numHopIters to start search for a primary key.numHopIters- number of hops iteration.- Returns:
- row location where the primary key present. if null then primary key is not found.
-
isRecordPresent
public RowLocation isRecordPresent(ItemList<SearchCell> primaryKey)
- Parameters:
primaryKey- record to search.- Returns:
- null only if record does not exist.
-
extractRecordsForVisibleColumns
public List<List<String>> extractRecordsForVisibleColumns(int numRecords, ItemList<HeaderColumnSI> headerColumns, VerticalScrollbar vScrollbar, org.sikuli.script.Region vScrollbarRegion, int numHops, int numHopIters)
It extracts the records from the datagrid only for the visible columns. Scrollbar is used to scroll through all the records in the datagrid. It will only return the unique records for the columns specified.- Parameters:
numRecords-headerColumns-vScrollbar-vScrollbarRegion-numHops-numHopIters-- Returns:
-
extractVisibleRecordsForVisibleColumns
public List<List<String>> extractVisibleRecordsForVisibleColumns(ItemList<HeaderColumnSI> headerColumns)
It extracts the visible records data only for the visible header columns on the screen.- Parameters:
headerColumns-- Returns:
-
validateRecordPresent
public void validateRecordPresent(ItemList<SearchCell> primaryKey)
- Parameters:
primaryKey- it contains columnName and TextValue to match
-
getCellRegion
public org.sikuli.script.Region getCellRegion(HeaderColumnSI headerColumn, RowLocation rowLocation, HorizontalScrollbar hScrollbar, int scrollStepsToLookup)
Cell is identified by header column location in row location. It returns the region of the cell. That can be further used to recognize UI objects inside this region.- Parameters:
headerColumn-rowLocation-hScrollbar-scrollStepsToLookup- it is the number of clicks to perform to search for the record.- Returns:
- the cell region
-
validateCellValuePresent
public void validateCellValuePresent(SearchCell cellValue, RowLocation rowLocation, HorizontalScrollbar hScrollbar, int scrollStepsToLookup)
-
isPresent
public boolean isPresent(int maxIterationsToLocateElements)
-
-