Dynamic Webtable Validation -- Logic Needed

In my webpage, I have a From and To time range filter and a submit button.When i choose relevant time range and press submit button, a webtable will be displayed according to the time range selected. I need to validate the data displayed in the webpage matches with my data in Mysql table.
(From my end, i have captured the webtable object using spyweb and created a database checkpoint and used take snapshot)… But strucked up with how to compare UI and DB data

Hi,

You can create custom keyword and use it. Following is the sample

public class GridHelper {

    /**
     * 1. Test Object for the web table
     * 2. Row Index
     * 3. Column Index
     *
     * */

    private TestObject getTestObject(TestObject baseTestObject,String xpath){
        /*
         * 1. Get the base xpath from the test object
         * 2. Append the additional xpath
         * 3. Create a new Test Object
         * 4. return the updated test object
         * 
         * */

        String baseXpath = baseTestObject.getProperties().get(0).getValue();
        String updatedXpath = baseXpath + xpath;

        TestObject updatedTestObject = new TestObject("Grid")
        updatedTestObject.addProperty("xpath", ConditionType.EQUALS, updatedXpath)
        return updatedTestObject
    }

    @Keyword
    public String GetValueFromGrid(TestObject baseTestObject,int rowIndex,int colIndex){
        TestObject updatedTestObject = getTestObject(baseTestObject,"/tr[" + rowIndex+  "]/td[" + colIndex + "]")
        return WebUI.getText(updatedTestObject)
    }

    @Keyword
    public String getValueOrClickOnColumn(TestObject baseTestObject,int rowIndex,int colIndex,String type){
        /**
         * Type = CheckBox //table[@role='grid']/tbody - base xpath --- /tr[index]/td[index]/input
         * Type = Button //table[@role='grid']/tbody - base xpath --- /tr[index]/td[index]/a
         * Type = Value //table[@role='grid']/tbody/tr[3]/td[3]
         * */


        TestObject updatedTestObject = null

        if("CheckBox".equalsIgnoreCase(type)){
            updatedTestObject = getTestObject(baseTestObject,"/tr[" + rowIndex+  "]/td[" + colIndex + "]/input")
            WebUI.click(updatedTestObject)
            return ""
        }else if("Button".equalsIgnoreCase(type)){
            updatedTestObject = getTestObject(baseTestObject,"/tr[" + rowIndex+  "]/td[" + colIndex + "]/a")
            WebUI.click(updatedTestObject)
            return ""
        }else {
            updatedTestObject = getTestObject(baseTestObject,"/tr[" + rowIndex+  "]/td[" + colIndex + "]")
            return WebUI.getText(updatedTestObject)
        }
    }
}


1.PNG

q1.PNG