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 |
in one page we have 100 links i have to click the 99th link how can i click the 99th link.
4 Answers GK Technologies, IBM,
If I change the property value at runtime is it effect is object repository?
I m new to QTP? Is it necessary to know VB for learning QTP for Automation? Can I understand QTP excellently Without practical automation?
Which object repository we use in real time and can we merge 2 object repostiory and how?
Differentiate the two Object Repository Types of QTP.
What is the disadvantage of smart identification?
what is functions in qtp?i know the userdefind &bulit funation or i know that Private public function ?plz tell me what is funations in qtp?how to create a funation in qtp
what is the abbrivation of .mtr in action reposirtory?
what is the data driven testing?
How to create runtime property for an object?
Is QTP supports Unix. If yes, then how the test automation is done?
how can i call an external action,which is not added external action of an action?