In an application you have a web table. You are provided
with an external Excel sheet with the same structure as that
of the web table.
How will you retrieve all data from the web table and
compare it with corresponding data available in the excel
sheet, using QTP?
How will you report the results in QTP?
Answer / saket bharti
'Get the Web Table Row and Col count using the GetROProperty
rowcount=
Browser("").Page("").WebTable("").GetRoProperty("rows")
colcount=
Browser("").Page("").WebTable("").GetRoProperty("cols")
'Create a Excel COM object to read the data from the file.
Set excelobj=CreateObject("Excel.Application")
Set excelbooks=excelobj.Workbooks.open("C:\Data-excel.xls")
Set excelsheets=excelobj.Worksheets.item("Sheet1")
'Now loop through the excel and the wettable and check their
values
for i=0 to rowcount
for j=0 to colcount
if (
Browser("").Page("").WebTable("").GetCellData(i,j)=excelsheets.Cells(i,j))
Then
Reporter.ReportEvent micPass ,"Validation","Cell values & i
& j are same"
Else
Reporter.ReportEvent micFail ,"Validation","Cell values & i
& j do not match"
End If
Next
Next
Is This Answer Correct ? | 8 Yes | 1 No |
How to open a new test using quicktest professional (qtp)?
Can we record a video in qtp recording??
What r types of parametarizations?
Hi How to retrieve data from web element line by line?
what is retesting?
How many types of recording facility are available in quicktest professional?
How to swap two numbers by using parameter passing method byref in a fucntion and return the result to outside of the function?
Hi, actually I completed Btech(CS). But i Will go to admin (Facility) interview. So, If Interviewer asking like " Why You choose this field". What we say? pLZ PLZ PLZ PLZ >............................................Send me.....
what type automation is fofollowed in the project?
If 3 browsers are opened in our system, how to enter the facebook url into second browser by using descriptive programing
What is the exact difference between QTP and RFT ?
what is stlc and its contents?