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 count the word "IS" is repeated in the application using DP
3 Answers DST Global Solutions,
who QTP recognizes the object stored in object repository?
Get the count of files of similar types from a folder.
What are the disadvantages of recording test cases in qtp?
Hai anyone please "Explain about Framework in QTP?"
in process of project exaplnation the defects are says frequently r not?
Explain key word driven frame work?How to use in real time?
Which advantages helping QTP to hold the position of "Market Leader" for such a long period?
How many lines of code in each script of QTP?
is it possible to operate(on/off)the capslock using qtp
what are the different u notice in betweem QTP version 8.2 and 9.2 and what is new in QTP9.2
When we parameterise some field ex. Textbox is there any way that we can generate a specefic number of random values (For alphabetical values if possible) instead of manually entering values in the data table