Class DataGridValidatorSI


  • public class DataGridValidatorSI
    extends Object
    Author:
    Madhav Krishna
    • Field Detail

      • logger

        protected org.slf4j.Logger logger
      • region

        protected org.sikuli.script.Region region
    • Constructor Detail

      • DataGridValidatorSI

        public DataGridValidatorSI​(SmartAppDriver appDriver,
                                   DataGridSI locator,
                                   org.sikuli.script.Region region)
    • Method Detail

      • 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,
                                           VerticalScrollbarSI 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 present
        numHops - 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,
                                                                  VerticalScrollbarSI 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,
                                                      HorizontalScrollbarSI 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
      • findRowMarkerY1

        protected Set<Integer> findRowMarkerY1()
      • isPresent

        public boolean isPresent​(int maxIterationsToLocateElements)