Page 1 of 1

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

Posted: Thu Jan 19, 2012 7:06 pm
by Mourasman
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

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

Posted: Fri Jan 20, 2012 11:33 am
by Support Team
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

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

Posted: Fri Jan 20, 2012 4:34 pm
by Mourasman
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

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

Posted: Mon Jan 23, 2012 12:24 pm
by Support Team
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

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

Posted: Mon Jan 23, 2012 6:47 pm
by Mourasman
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

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

Posted: Tue Jan 24, 2012 9:57 am
by Support Team
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