Micro Focus QTP (UFT) Forums
output check point - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: output check point (/Thread-output-check-point)

Pages: 1 2


RE: output check point - ravi.gajul - 11-01-2011

Hi Azad,
Try this
Code:
DataTable.Value("MPI","Global")=Browser("micclass:=Browser").Page("micclass:=Page").object.getElementsByTagName("H3")(0).innertext

If your page has more than one <H3> Tags and if the text you are requesting for, is not in the first <H3> Tag, the above code will not give the value you are expecting.In that case replace the 0 in above code with some value say i and to determine i's value run the the below code
Code:
set oWebElement=Browser("micclass:=Browser").Page("micclass:=Page").object.getElementsByTagName("H3")
For i= 0 to oWebElement.length-1
   msgbox  "  i= "& i  &"    And  text = " & oWebElement(i).innertext
Next

Hope this helps you
Regards,
Ravi


RE: output check point - Ankesh - 11-02-2011

Hi Azad,

Ur Code..

Code:
Datatable.GlobalSheet.AddParameter"MPI",""
DataTable("MPI","Global")= Browser("micclass:=Browser").Page("micclass:=Page").WebElement("html tag:=H3","outerhtml:=<H3>$2,997.75</H3>").GetRoProperty("innertext")

The above code will not work as the outerhtml property contains few special characters($,.). You need to ignore\escape these characters using Regular expression escape character...

Use the below code and see if it works..

Code:
DataTable("MPI","Global")= Browser("micclass:=Browser").Page("micclass:=Page").WebElement("html tag:=H3","outerhtml:=<H3>\$2,997\.75</H3>").GetRoProperty("innertext")
OR
Code:
DataTable("MPI","Global")= Browser("micclass:=Browser").Page("micclass:=Page").WebElement("html tag:=H3","outerhtml:=\<H3\>\$2,997\.75\<\/H3\>").GetRoProperty("innertext")

=================================================================
There is one more solution to your issue if you know what value you are looking for on the page.

Code:
strPageContent=Browser(<BrowserName>).Page(<PageName>).Object.body.innertext

now strPageContent will contain all the data present on the page. You can use the Instr function to search for your value.

Do let me know if this desn't help or if you have any other query.

Regards,
Ankesh