iOS real device not getting real value from UIAStaticText

Whether using UIAutomator (ios9.x, Appium 1.53) or XCUITest (ios10.x, Appium 1.6) automation works fine but I’m unable to get the value of a specific UIAStaticText element. Instead of the value displayed on screen (some name) I get value ‘challenge’.
The pagesource XML as the server json also do not contain the real displayed value (some name) so the question is: if not in xml or json is there any way to get the value at all?

The only thing I found is that this might be related to some iOS bug: http://stackoverflow.com/questions/7688311/cant-get-value-of-uiastatictext
Note, I’m not the owner of the app so can’t adjust source.

Example of element in pagesource xml:
XCUIElementTypeStaticText name=“challenge” label=“challenge” value=“challenge” dom="" enabled=“true” valid=“true” visible=“true” hint="" path="/0/0/0/0/1/0/0/0/0/1/1" x=“188” y=“212” width=“139” height=“26”

Thanks,
-M

Anyone can answer this question please?

If not in xml or json is there any way to get the value at all?

Thanks,
-M

hi.

what you want to get? value “challenge” ? How you trying to get it in code?

Thanks Aleksei,

Value ‘challenge’ is not the real value, the real value in App on screen is a random name like ‘Aleksei’
Getting the value with (element).text or with (element).GetAttribute(“value”) both always give ‘challenge’

Since this matches the value in XML I wonder if is it possible to get the real value at all since as far as I understand the selection options elementByName, elementByXpath etc just search the XML

Thanks,
-M

possible if you do care it iOS code. normally we (automation QA) do it instead of iOS dev.

example line from code:
self.accessibilityValue = NSLocalizedString(value, comment: "")

Thanks Aleksei,

So I need to inform the App developers to set the accessibilityValue.
Otherwise it’s not possible to retrieve or narrate this value right?

Thanks,
-M

yes. and after that “value” attribute will have needed value.

Hi Aleksei,

Adjusted the code for the devs, will have to wait for a new release.

Thanks for your help,
-M