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 WebBrowserbrowserprotected DataGridSIdataGridprotected org.slf4j.Loggerloggerprotected org.sikuli.script.Regionregion -
Constructor Summary
Constructors Constructor Description DataGridValidatorSI(WebBrowser browser, DataGridSI locator, org.sikuli.script.Region region) -
Method Summary
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 numRetries)It initializes the datagrid location on the screen.protected voidinitializeDataGridHeader(int numRetries)protected booleanisHScrollingRequired()booleanisPresent(int numRetries)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 Details
-
logger
protected org.slf4j.Logger logger -
browser
-
dataGrid
-
region
protected org.sikuli.script.Region region
-
-
Constructor Details
-
DataGridValidatorSI
public DataGridValidatorSI(WebBrowser browser, DataGridSI locator, org.sikuli.script.Region region)
-
-
Method Details
-
getUIObject
-
initializeDataGridHeader
protected void initializeDataGridHeader(int numRetries) -
initializeDataGrid
public void initializeDataGrid(int numRetries)It initializes the datagrid location on the screen. It also initializes the data grid record area.- Parameters:
numRetries-
-
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
- 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
- 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) -
findRowMarkerY1
-
isPresent
public boolean isPresent(int numRetries)
-