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 |
Explain types of descriptive programming?
While scripting do we use any reference. may be we have 2 0r more same objects that time how do we write scripts
How you automate testscripts one by one or moduelwise or all at once
What is the use of an object spy tool in qtp?
CAN WE USE 'BVA' AND 'ECP' IN AUTOMATION?
How to automate a script in mainframes environment? I have the terminal emulator Add in. Describe in detail.
how do i know how to use tools
I am not finding pages and links in object spy on web testing. I am only getting window and winobject. where is the problem? thanks
what is the difference between Table checkpoint and Database checkpoint in QTP
how to write script in qtp(vbscript)..i mean with out application deployed..and how to call script1 into script2?
8 Answers INCA, Infosys, Logix, SLK Software, Symphony, Wipro,
Hai anyone please "Explain about Framework in QTP?"
write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object..