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 |
when i try to recognise a winmenu item it does not allow me to do that but recognises it as window..i am using qtp 9.2 could someone help with this
What is text/text area checkpoint?
pls guys understand this is question CAREFULLY,,, interviwer asks can u write test case for ATM m/c..i told, insert card enter pw...like this,,but interviwer not happy with that...ur not going to atm center? in ur office system ur testing ATM M/c...why ..how to test? what is the process?
what is the extension for QTP files?
How to use output values in qtp ?
Connect to QC using AOM.
How do you open adobe acrobat file in QTP and do some testing on that file ?
If a script has a local repository and also uses a shared repository, which repository will QTP use first when searching for an object during playback?
Did QTP prove efficient for your project? Yes or No, explain?
how many test scripts we will write in qtp? very urgent. please??? Thanks in advance..
How u call functions in QTP Function to calculate the length of characters in a word -
what is Synchronization point in QTP?Can anybody give a perfect example on it Thanks in advance