Uiautomation iOS uilabel value

I am trying to get the value from UILabel by executing target.logElementTree(), but I cannot see the value that is actually set in Label.

It shows only the line we set based on accessibilityLabel

self.settlementDate.isAccessibilityElement = YES;
self.settlementDate.accessibilityLabel = @"DetailViewInCode_SettlementDate";

And at target.logElementTree()that value, which I see in the tool-Automation log

UIAStaticText: name:DetailViewInCode_SettlementDate value:DetailViewInCode_SettlementDate rect:{{260, 345}, {304, 21}}    

UIALogger.logMessage("Target static:"+target.frontMostApp().mainWindow().staticTexts()["Activity_DetailedView_SettlementDate"].value());

And I see a screenshot when I click on this entry
enter image description here

iOS 5.1 Simulator

+3
source share
2 answers

It seems that the value is set by default with the value of the accessibilityLabel property. Try setting the accessibilityValue property in your code the same way you set the accessibilityLabel property.

self.settlementDate.accessibilityValue = <ActualVale>;
+3
source

. DetailViewInCode_SettlementDate. , , , . .

-1

All Articles