iOS尝试选择拾取器元素时出现UITest错误

问题描述:

我想选择拾取器的元素,拾取器具有辅助功能= picker_station,为什么我可以这样做?有什么问题吗?或者我需要使用其他代码。iOS尝试选择拾取器元素时出现UITest错误

let app = XCUIApplication() 
app.pickers["picker_station"].pickerWheels.element.adjust(toPickerWheelValue: "Aberdeen") 

Xcode的错误是:

Testing Failure - Internal error: unable to find current value '1 of 152' in possible values 

感谢

您正确使用它,但adjust(toPickerWheelValue:)方法是越野车,因为这里讨论:https://forums.developer.apple.com/thread/16104