Find ErrorString IN Flex Text Fields

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Find ErrorString IN Flex Text Fields

Post by dlister1001 » Thu Nov 25, 2010 6:59 pm

Is there a way to retreive error string text attribute from a flex 3 text field?
I tried to see the text through the Ranoxex spy tool but was unsuccessful.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Find ErrorString IN Flex Text Fields

Post by Support Team » Fri Nov 26, 2010 9:15 am

Hi,

Please could you post us a Ranorex Snapshot of the expected control with an error text in it? So we can maybe provide you a possible RxPath to get the text of the error control.

How to create a Snapshot
http://www.ranorex.com/support/user-gui ... html#c2072

Regards,
Peter
Ranorex Team

dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Re: Find ErrorString IN Flex Text Fields

Post by dlister1001 » Fri Nov 26, 2010 12:53 pm

I have included one.

The required text is "This field is required"
I have been able to use another tool where is finds the text as a property of the flex field
Empty Field.rxsnp
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Find ErrorString IN Flex Text Fields

Post by Support Team » Fri Nov 26, 2010 1:10 pm

Hi,

Thank you for the Snapshot. This text is some kind of tool tip right? I am not able to provide you a RxPath. Please can you send me one snapshot again of the entire application. I think the text for the "tool tip" is nested on a different level.

Thank you.
Regards,
Peter
Ranorex Team

dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Re: Find ErrorString IN Flex Text Fields

Post by dlister1001 » Fri Nov 26, 2010 2:43 pm

Here are the notes on the field from the adobe website:

Showing a validation error by using errorString

The UIComponent class defines the errorString property that you can use to show a validation error for a component, without actually using a validator class. When you write a String value to the UIComponent.errorString property, Flex draws a red border around the component to indicate the validation error, and the String appears in a ToolTip as the validation error message when you move the mouse over the component, just as if a validator detected a validation error.

To clear the validation error, write an empty String, " ", to the UIComponent.errorString property.

I have included a structued snap shot of the app.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Find ErrorString IN Flex Text Fields

Post by Support Team » Mon Nov 29, 2010 12:37 pm

Hi,

I've tried some kind of example with errorString by myself. Try to track the edit box holding your error message with Ranorex Spy. If you track this edit box during the tool tip is visible you can access the tooltip in Spy (e.g. /dom[5]/body/flexobject/tooltip) and can also access it's text attribute, which holds the error text. So the tooltip can only be accessed if it's visible for Ranorex.

I hope this helps you soving your issue.

Regards,
Tobias
Support Team

dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Re: Find ErrorString IN Flex Text Fields

Post by dlister1001 » Mon Nov 29, 2010 1:06 pm

Hey Peter,

Maybe I am applying the path you suggested wrong but I went back with the tool tracker and tracked the text field only once the tool tip is displayed with the following path:

'form/container[3]/text[@id='FirstName']'

and then modified the path to 'form/container[3]/text[@id='FirstName']/tooltip' and Ranorex Spy still does not seem to be able to find it in the tracker. Is the path I am using incorrect? Were you able to see the object in the snapshots I had previously sent?

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Find ErrorString IN Flex Text Fields

Post by Support Team » Mon Nov 29, 2010 1:41 pm

Hi,

the problem is - as mentioned above - that the tootlip is only accesible for Ranorex if it is visible in the UI. So You can only access the tooltip if the mouse cursor is over the edit box which generates the tooltip.
If you want to automate a request of the tooltip text you first have to make it visible by movint the mouse over the edit box.

Your code should look something like this:
// move to repository item of the edit box
repo.WebDocument.editBox.MoveTo();
// validate the text held by the tooltip
Validate.Attribute(repo.WebDocument.ToolTip, "Text", "<the text you want to verify>");
I hope this works for you.

Regards,
Tobias
Support Team

dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Re: Find ErrorString IN Flex Text Fields

Post by dlister1001 » Mon Nov 29, 2010 3:12 pm

Hey Tobias

Is there a way to get ranorex spy to hold the tooltip? Once I click on the field that has the tooltip visible the tooltip changes not longer visible and the spy does not pick it up

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Find ErrorString IN Flex Text Fields

Post by Support Team » Mon Nov 29, 2010 3:32 pm

Hi,

during tracking of the edit field you have to mention that the tooltip is visible. If the tooltip is visible at that point the tooltip is also visible in spy.

Kind regards,
Tobias
Support Team

dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Re: Find ErrorString IN Flex Text Fields

Post by dlister1001 » Mon Nov 29, 2010 4:22 pm

Hey Tobias,

I am not sure I follow, currently I am just trying to grab the tool tip with Ranorex Spy and I look at the snap shot after I take with the spy on the ebitable field and the snap shot shows no association to a tooltip. I retired this with the recorded and the hot key 'T' for the tool tip but again nothing was picked up by the recorder

For the code you mentioned earlier:

Validate.Attribute(repo.WebDocument.ToolTip, "Text", "<the text you want to verify>");

Since tooltip is not part of the repository Ranorex just passes that back as an error.

Regards

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Find ErrorString IN Flex Text Fields

Post by Support Team » Mon Nov 29, 2010 6:32 pm

Did you try instant tracking? That way you don't need to click on the field, you only have to move over it.
http://www.ranorex.com/support/user-gui ... html#c1797

If that does not work, try to instant track the whole application when the tooltip is visible and then press the <Scroll> key (while the tooltip is still visible). That will generate a snapshot of the currently selected element and this snapshot should (hopefully) contain the tooltip. See this section in the Ranorex User Guide for more info.

Regards,
Alex
Ranorex Team

dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Re: Find ErrorString IN Flex Text Fields

Post by dlister1001 » Mon Nov 29, 2010 7:00 pm

Hey Alex,

I have included a snapshot of the tooltip I was able to get following the method you suggested, but again the tooltip can not be accessed, but this time it can been seen in the capture
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Find ErrorString IN Flex Text Fields

Post by Support Team » Tue Nov 30, 2010 9:41 am

Hi,

can you please send us send us a snapshot of the whole application under test as described in our last post
If that does not work, try to instant track the whole application when the tooltip is visible and then press the <Scroll> key (while the tooltip is still visible). That will generate a snapshot of the currently selected element and this snapshot should (hopefully) contain the tooltip. See this section in the Ranorex User Guide for more info.
And additionally can you please send us some sample code on how you generate your errorString.

Thanks.

Regards,
Tobias
Support Team

dlister1001
Posts: 8
Joined: Thu Nov 25, 2010 6:33 pm

Re: Find ErrorString IN Flex Text Fields

Post by dlister1001 » Tue Nov 30, 2010 2:49 pm

I cannot get a snap shot of the entire system with the tool tip displaying. It disappears from the spy once I start click on other forms, the previous snapshot is the best I can grab.

Here is the exert from the site:
<?xml version="1.0"?>
<!-- validators\PNValidatorErrMessage.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<!-- Define the PhoneNumberValidator. -->
<mx:PhoneNumberValidator id="pnV"
source="{phoneInput}" property="text"
wrongLengthError="Please enter a 10-digit number."/>

<!-- Define the TextInput control for entering the phone number. -->
<mx:TextInput id="phoneInput"/>
<mx:TextInput id="zipCodeInput"/>
</mx:Application>