Write a script for comparing the content in excel file and the webtable in a webpage? - TestingQ.com

-->Exclusive Portal for Testing Jobs

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



To receive daily posted JOBS & Interview Questions
Just enter your email address below and click 'Submit'
Enter your email address:

Make sure to activate your subscription by clicking on the activation link sent to your email