05-16-2011, 10:29 PM
Hi Guys, greetings from Mexico!
I have to automate a Web-Based application which has a "dirty" HTML code. The issue is that the HTML is malformed (e.g. tables, column and rows not closed, unclosed links etc..) and QTP is not recognizing elements correctly on the page.
I have tried descriptive programming but that's not enough since i'm trying to pull data from tables that sometimes are not recognized. I have also tried pulling data from all "available" tables within the page (even this way... some tables are not pulled, seeem to be invisible)...
Any ideas guys? Really need some help!
Example of my code:
(even using this function, some data is not retrieved)
End Function
'********************************************************************************
I have to automate a Web-Based application which has a "dirty" HTML code. The issue is that the HTML is malformed (e.g. tables, column and rows not closed, unclosed links etc..) and QTP is not recognizing elements correctly on the page.
I have tried descriptive programming but that's not enough since i'm trying to pull data from tables that sometimes are not recognized. I have also tried pulling data from all "available" tables within the page (even this way... some tables are not pulled, seeem to be invisible)...
Any ideas guys? Really need some help!
Example of my code:
(even using this function, some data is not retrieved)
Code:
tblData = getAllTablesInnerText()
Function getAllTablesInnerText()
Dim i, num, rc, oDesc, roProperty
Dim cadObjs, arrObjs
Dim regexBrowser, regexPage
Dim innerText
Dim textTables
roProperty = "innerText"
regexBrowser ="title:=.*Enlace.*"
regexPage = "title:=.*Enlace.*"
Set oDesc=Description.Create
oDesc("micclass").Value= "WebTable"
Set rc = Browser(regexBrowser).Page(regexPage).ChildObjects(oDesc)
num = rc.Count() '
For i=0 To num -1
print "Parseando tabla " & i & "..."
innerText = rc(i).GetROProperty(roProperty)
textTables = textTables & "<TABLA " & i & ">:" & innerText
Next
getAllTablesInnerText = textTables
End Function
'********************************************************************************