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 Posted / 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 |
Post New Answer View All Answers
How do we handle run-time errors?
Can we record using all the modes in a single script? Explanation with example is appreciated
How to handle the exceptions using recovery secnario manager in quicktest professional (qtp)?
Explain about datafile/verification of date file when file is not available in local system?
how can i pass a "cript"as a parameter in to a function
how to create flat file datasubmission in qtp
In what occasion we can specify global sheet and action sheet?
How many types of recording facility are available in quicktest professional?
In qtp, explain what is crypt object
UFT 12.02 which ALM version will support
In order to select an automation tool for automating ur application, what r the things u need to consider? For eg i will go for automation; 1) When there is a lot of retesting and regression testing. 2) Return on investments. 3) Whether the tool supports the appln. 4)--------------, etc. Pls give me more number of points because my answer did not satisfy the interviewer. Very urgent pls
i want information about API testing and i want info like how process can be done in company? i want added info like coding ,debugging, desing in c.v ? what should add in c.v for eg banking domin? pls any answer my question?
How to handle the exceptions using the recovery scenario manager in qtp?
For example you are checking bit map check point before coming to the results. How can you say it is passed? Or failed? Anyways?
what is the latest version of QTP? Main difference between 9.2 and 10 version