Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UIAutomation with tuneup.js:是否可以使用.value()和.name()方法以外的方法访问标签(UIStatic文本)字符串?_Ios_Ui Automation_Ios Ui Automation - Fatal编程技术网

Ios UIAutomation with tuneup.js:是否可以使用.value()和.name()方法以外的方法访问标签(UIStatic文本)字符串?

Ios UIAutomation with tuneup.js:是否可以使用.value()和.name()方法以外的方法访问标签(UIStatic文本)字符串?,ios,ui-automation,ios-ui-automation,Ios,Ui Automation,Ios Ui Automation,我必须验证应用程序中的标签文本。应用程序中显示的实际字符串是“Elements”,但“logElementTree();”将静态文本的名称和值显示为“MyValue”。因此,请告诉我在这种情况下如何验证应用程序中显示的实际文本。提前感谢。我经常看到,当通过logElementTree()访问时,statictext()name()或value()不会返回 这在过去帮助了我。 您可以尝试将其存储为变量,并检查变量返回的内容: var labelName=target.frontMostApp().

我必须验证应用程序中的标签文本。应用程序中显示的实际字符串是“Elements”,但“logElementTree();”将静态文本的名称和值显示为“MyValue”。因此,请告诉我在这种情况下如何验证应用程序中显示的实际文本。提前感谢。

我经常看到,当通过
logElementTree()
访问时,
statictext()
name()
value()
不会返回

这在过去帮助了我。 您可以尝试将其存储为变量,并检查变量返回的内容:

var labelName=target.frontMostApp().mainWindow().staticText()[0].name()
UIALogger.logMessage(labelName)

staticText()[0]
取决于它的值。以上只是一个例子


有时,当它实际存储在一个变量中并从日志中显示时,它实际上会给出标签的值,如应用程序中所示。

您能发布有关静态文本的logElementTree结果吗?