08-02-2011, 05:21 PM
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!
QTP throws more than one object found for the property
Can anyone help me in this?
Many thanks
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