"GetPropertyValue" doesn't always work (for me)

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Mourasman
Posts: 29
Joined: Fri Oct 21, 2011 6:09 pm

"GetPropertyValue" doesn't always work (for me)

Post by Mourasman » Thu Jan 19, 2012 7:06 pm

Hey guys,

I have a sample Flex application, that has an mx:TextInput with the "maxChars" property defined to 10. When I try to use GetPropertyValue, it keeps returning "null".

I also tried changing the element to a spark component (s:TextInput) and still happens the same thing...

Any idea why?

I've attached the snapshot, if it helps... The element is "TextInput".

Best regards,
Mourasman
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: "GetPropertyValue" doesn't always work (for me)

Post by Support Team » Fri Jan 20, 2012 11:33 am

Hi,

I used following code to get the maxChar attribute and it works as expected.
FlexElement textTextInput = "/dom[@page='GetPropTest.html']/body/flexobject/text[@type='TextInput']";
WinForms.MessageBox.Show(textTextInput.GetPropertyValue("maxChars"));
Would it be possible to post me your code and maybe we can access your application?

In the future Ranorex will support Dynamic Capabilities, then this property will shown up in Spy beside many others. :)

Regards,
Peter
Ranorex Team

Mourasman
Posts: 29
Joined: Fri Oct 21, 2011 6:09 pm

Re: "GetPropertyValue" doesn't always work (for me)

Post by Mourasman » Fri Jan 20, 2012 4:34 pm

Hello,

Thanks for your reply!

The code is this simple. Nothing fancy here, I'm just testing this method.

My application is attached. It's just an .html with a bunch of .swf files.

EDIT: .mxml added, just in case.

Best regards,
Mourasman
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: "GetPropertyValue" doesn't always work (for me)

Post by Support Team » Mon Jan 23, 2012 12:24 pm

Hi,
Mourasman wrote:EDIT: .mxml added, just in case.
I cannot find the mxml file. Please could you post this file, because i need this to validate your code and take a look to the property you trying to get with Ranorex.

Thanks and regards,
Peter
Ranorex Team

Mourasman
Posts: 29
Joined: Fri Oct 21, 2011 6:09 pm

Re: "GetPropertyValue" doesn't always work (for me)

Post by Mourasman » Mon Jan 23, 2012 6:47 pm

Hey there!

It appears the forum doesn't support uploading .mxml files so I renamed the extension to .txt. That's why I didn't see the file wasn't uploaded. Be sure to change it back :)

Best regards,
Mourasman
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: "GetPropertyValue" doesn't always work (for me)

Post by Support Team » Tue Jan 24, 2012 9:57 am

Hi,

Thank you for the mxml file. I tried your sample and Ranorex was able to retrieve the maxChars property. I used following code
FlexElement testGetProp = "/dom[@page='GetPropTest.html']/body/flexobject/container/text[@id='testTextBox']";
var test = testGetProp.GetPropertyValue("maxChars");
Please try the posted code and adapt the RxPath to your input field.

Regards,
Peter
Ranorex Team