Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.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
有人有过UIAutomation for Xcode的经验吗?_Xcode_Ios4_Ui Automation - Fatal编程技术网

有人有过UIAutomation for Xcode的经验吗?

有人有过UIAutomation for Xcode的经验吗?,xcode,ios4,ui-automation,Xcode,Ios4,Ui Automation,你好 我正在iPhone 3GS上运行iOS 4.1 我有一个小的测试应用程序,它有一个连接到UIView(?)的五段分段控制器。单击五段中的一段时,图像在视图中发生更改 我正在尝试使用以下js脚本,使用UIAutomation实现自动化: UIALogger.logStart("picChoice Test Started"); var mySegment = (UIAElementArray) segmentedControls() [2]; UIATarget.localTarget(

你好

我正在iPhone 3GS上运行iOS 4.1

我有一个小的测试应用程序,它有一个连接到UIView(?)的五段分段控制器。单击五段中的一段时,图像在视图中发生更改

我正在尝试使用以下js脚本,使用UIAutomation实现自动化:

UIALogger.logStart("picChoice Test Started");

var mySegment = (UIAElementArray) segmentedControls() [2];

UIATarget.localTarget().frontMostApp().mainWindow().mySegment.tap();
我的脚本在通过仪器的自动化工具运行时出现语法错误而失败

有没有人对如何正确编写脚本有什么建议(请原谅这个糟糕的双关语)

TIA适用于所有亚洲国家

问候,

史蒂夫·奥沙利文

我想你想要的是(没有测试):

请注意,segmentedControls()[2]返回的是一个元素而不是数组,并且在使用segmentedControls时,没有上下文来查找分段控件。

我认为您想要的是(没有测试它):

请注意,segmentedControls()[2]返回的是一个元素而不是数组,并且在使用segmentedControls时,没有上下文来查找分段控件

UIALogger.logStart("picChoice Test Started");
UIATarget.localTarget().frontMostApp().mainWindow().segmentedControls()[2].tap();