Setting attribute 'text' failed on element

Mobile Testing, Android App Testing.
Oksana
Posts: 64
Joined: Tue Jan 15, 2013 10:20 am

Setting attribute 'text' failed on element

Post by Oksana » Fri Nov 06, 2015 1:36 pm

Hi!

Can you provide me any help with solving such issue?

When I try to set some value for iOS text element (manually from Ranorex Spy tool; from code using .TextValue property; from code using .Element.SetAttributeValue("Text", "")) occurs exception (or appears 'Properties Window' in the Spy, see attached image) saying 'Setting attribute 'text' failed on element ...'

This error can be reproduced also in the 'ranorex.RxBrowser' app (text element for url), but not in the 'ranorex.MiniKeePass'.
Devices with iOS 9.1 and 8.4.1 .
Ranorex 5.4.3 (there is no such issue for 5.4.2, but I can't go back to older version, since it doesn't support iOS 9)
RxServiceApp 2.1.0

Regards,
Oksana
You do not have the required permissions to view the files attached to this post.

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: Setting attribute 'text' failed on element

Post by tvu » Mon Nov 09, 2015 5:06 pm

We are facing the same issue. It happens to us about 25% of the time. We sent Support an IPA of my app to troubleshoot, but they haven't given us a solution yet. In the meantime, we wrote some code to type in the string using the PressKeys() method.

Additionally, when setting the text value did work we were facing the issue where setting the value sometimes sends the "Enter" key at the end of the string and sometimes it doesn't. We had to add some logic to handle that scenario.

Otter_T
Posts: 18
Joined: Mon Aug 31, 2015 5:33 pm

Re: Setting attribute 'text' failed on element

Post by Otter_T » Mon Nov 09, 2015 6:58 pm

I believe this is the same issue I'm having, and it seems to have started with 5.4.3. Running test on iPad with iOS 8. Rxlog says:

Setting attribute 'Text' failed on element '{Text:userId}'.
-[__NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds

It's not an object recognition issue, because after the test fails, I can do a "Highlight Element" and Ranorex finds/highlights the element immediately.

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

Re: Setting attribute 'text' failed on element

Post by Support Team » Fri Nov 13, 2015 10:28 pm

Hello All,

Thank you for bring this up to our attention. We have been able to reproduce this issue and are diligently working on creating a fix for this.

It appears as if this is caused by instrumenting the application via the instrumentation wizard.

Furthermore, as a workaround for the meantime you could instrument the application through Source-Code.