10-08-2010, 11:29 AM
Hi Harp,
In this case we are not able to use our normal (simple) approach to get the data of web table into Excel Sheet. There are 2 reasons of that:
1. If you add any data of the web table into repository, it's taking "innertext" & "html tag" as the mandatory property. The hierarchy is Browser->Page->WebElement (Data Table is note taken) and RE for Web Element also not working.
2. By using any combination of web table properties, QTP is not recognizing the table while using Descriptive Programming.
But there is an alternative solution:
The below code will give you the content of the table. You have to put that content at correct location in Excel Sheet. You can use properties like "class" etc.
I hope it will work for you....
In this case we are not able to use our normal (simple) approach to get the data of web table into Excel Sheet. There are 2 reasons of that:
1. If you add any data of the web table into repository, it's taking "innertext" & "html tag" as the mandatory property. The hierarchy is Browser->Page->WebElement (Data Table is note taken) and RE for Web Element also not working.
2. By using any combination of web table properties, QTP is not recognizing the table while using Descriptive Programming.
But there is an alternative solution:
The below code will give you the content of the table. You have to put that content at correct location in Excel Sheet. You can use properties like "class" etc.
Code:
Set objDesc = Description.Create
objDesc( "micclass" ).value = "WebElement"
objDesc( "html tag" ).value = "TD"
' objDesc( "class" ).value = "in-l-10"
Set arrObj = Browser("name:=Financial Analysis").Page("title:=Financial Analysis").ChildObjects(objDesc)
total = arrObj.count
MsgBox total
For i=0 to total-1
data= arrObj(i).GetROProperty("innerhtml")
print data
Next
I hope it will work for you....