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 |
where the object repository is located?how to choose the object repository as shared or action object repositories?
What is qtpro? What is quick test pro? What is a quick test professional?
What is the difference between "Call to copy of action", "Call to existing action" & "Call to winrunner action"?
how u will describe testing activities?
Hi PLZ explain User Defined Functions in QTP with eample?
Hi Guys, My Application in Microsoft Dynamic Navision, is it compitibale with QTP? if yes then let me know...
Where we write the FUNCTIONS, in Expert view (or) in any textfiles like Notepad and save it in Library functions folder? How to cal that functions to our script? How to save that functions to Function generator?
what is throw object ?
If enter into interviewer room? how u introduce with him. with shakehand or waht?
Hi friends, In a particular test how many maximum call to new actions we can call?It reusable or normal actions what ever it is .
Does QTP support flat files? If yes what are those?
Hi, Can anyone write the following qtp script...please its urgent ·Navigate to Google in a new IE instance ·Search for the following word "Gap, Inc." ·Iterate thought the first 10 pages of google ·On each page collect the following ·The "blue" page title ·The "green" url ·Output all the data into a file named "test_output.txt" ·Format "Title – URL"