我一直在 UIAutomation 中使用 UIAPickerWheel 来测试 UIDatePicker。这是一个由月、日和年轮组成的日期选择器。这是我的代码。
var monthWheel = w.pickers()[0].wheels()[0];
UIALogger.logMessage(monthWheel.logElementTree()); // This line output seems right
// 5) UIAPickerWheel [name:(null) value:September rect:{{x:21, y:265}, {width:147, height:216}}]
UIALogger.logMessage(monthWheel.isValid()); // This line output 1
var length = monthWheel.values().length; // error: "Result of expression 'monthWheel.values()' [null] is not an object.";