hi getafix, I think you should add 1 more property to the webelement. Like you can use its x and y coordinates to uniquely identify this webelement.
On Aug 2, 4:57 pm, Getafix <[email protected]> wrote: > Hi, > > I am wondering how to get the dynamic text displayed for a webelement > based on its innertext > > Here i am not exactly sure of which webelement , but all i know is the > webelement that would display the text will contain " - " in it > that is [spacehyphenspace] > > for example innertext="Comp - trip not valid" > > I want to capture the text displayed by this webelement. > > 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! > 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 -- You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en
