在以下UI自动化脚本代码中,我能够从UIPickerView获取值,但无法选择选择器:

var picker = window.pickers();

UIALogger.logMessage("picker array count: " + picker.length);

var pickerWheels = picker[0].wheels();

UIALogger.logMessage("picker Wheel count: " + pickerWheels.length);

var pickerWheelsValues =pickerWheels[0].values();

UIALogger.logMessage("picker Values count: " + pickerWheelsValues);

pickerWheels[0].values()[0].tap();


我可能做错了什么?

最佳答案

答案在apple dev forums消息242678中。

本质上,您必须:

pickerWheel.tapWithOptions({x:hitPointX, y:hitPointY}, {touchCount:1, tapCount:1});


诀窍是,hitPoint必须位于下一行或上一行。

10-06 07:33