Write a script for comparing the content in excel file and the webtable in a webpage?

Ans:
objTable=Browser().page().WebTable()

intRows=objTable.RowCount

intCols=objTable.ColumnCount (intRows)

Set xlApp=CreateObject("Excel.Application")

Set xlWrkBook=xlApp.Workbooks.Open("Path of the xls File")

Set xlSheet=xlWrkBook.Worksheets(SheetId)

For i = 1 to intRows                           

        For j=1 to intCols

                If Trim(objTable.GetCellData(i,j))=Trim(xlSheet.Cells(i,j)) Then
                        msgbox "matching data"
                else
                        msgbox "data is different in cells " & i & j 
                End If
        Next 
Next

Subscribe to TestingQ.Net

To receive daily posted Interview Questions
Just enter your email address below and click 'Subscribe'

Enter your email address: