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 many types of status are there?
what properties do use to identify a browser and page while using descriptive programming?
Can any body tell me how can I choose the share object repository and per action object repository mode. Please give me with steps.
Please let know the scripts for counting number of repeated letters in the word. Note repeated letter should not be count agian. Ex: If "Hello" is my word... l is coming twice.. it should count once and print... secong 'l' should not count again..
Write a script to delete the a specific row (say 3rd) in a webtable.
How can we see the analog recording steps in QTP..the Steps are stored in a track file with an extension .dat..how can we open the file..
I have recorded a test over web application(with IE6.0) in analog mode. But, while running it my test gets failed. Why? (Note: my systray has 3 open web applications)
I have 1 to 10 action are there, i want action1 output becomes to action 10 input? pls any can give script for this scenario?
suppose i opened 6browsers and i want re-open the 4browser what is code for this..pls help me..
How to handle dynamic objects in quicktest professional?
Explain how Selenium is different from UFT?
How to use debug tools?