Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetROProperty
#1
Not Solved
Hi,

In my application page an error text is displayed against any of the following fields like Account,Docket,Trip.

For example :

Field : Status
Account : Invalid - account
Docket : Invalid - docket
Trip : Invalid - trip

The innertext values for these are Invalid - account,Invalid - docket,Invalid - trip (note these is a space before&after the hyphen)

Each of these fields are individual web elements
But the page can only have only one field with the error text
That is, either Invalid-account or Invalid - docket or Invalid - trip is displayed.
It can't have 2 or more.
My requirement is to catch the displayed text ( invalid-account or Invalid-docket or Invalid-trip)

I thought of using GetROproperty to get the innertext to a variable and display it in my result

I used the following code strategy but no luck!
Code:
var=Browser("Home").Page("View Trip_3").WebElement("innertext:=.* - .*").GetROProperty("innertext")
Msgbox var
Reporter.ReportEvent micFail,"Check docket error status","Incorrect status displayed: "&var

QTP throws more than one object found for the property

Can anyone help me in this?

Many thanks
Reply
#2
Not Solved
You are getting the error due to more than one webelement on the page..

U can try this..
get the whole body text of the page using

Code:
strBodyText=Browser().Page().Object.body.innertext

now you can search for the any of the three errors that u mentioned like
Code:
if Instr(strBodyText,"text to be searhed")>0 Then

  Reporter.....
End IF

Let me know if u have any query,

Regards,
Ankesh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Smile How to Select GetROproperty value in GUI sangitarm 2 4,654 10-15-2012, 11:52 PM
Last Post: agarwl.anurag
  GetROProperty help mv8167 1 2,782 06-26-2012, 11:53 PM
Last Post: supputuri
  GetROProperty error when used in a for loop JustLag 2 2,944 05-15-2012, 08:19 PM
Last Post: JustLag
  Generate Run time error on Allchkboxes(i).GetROProperty("all items") Langxii 1 3,635 07-06-2011, 09:34 AM
Last Post: rajpes
  Retrieving GetTOProperty and GetROProperty manmeet.singh81 1 6,464 06-08-2011, 12:01 PM
Last Post: Jay

Forum Jump:


Users browsing this thread: 1 Guest(s)