Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.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
如何使用Ruby在iOS PickerWheel中自动选择值_Ios_Ruby_Automation_Cucumber - Fatal编程技术网

如何使用Ruby在iOS PickerWheel中自动选择值

如何使用Ruby在iOS PickerWheel中自动选择值,ios,ruby,automation,cucumber,Ios,Ruby,Automation,Cucumber,我一直在用Ruby和Cucumber框架自动化一个应用程序。在这个框架内,我正在使用XUITest实现iOS自动化 根据我所做的研究,似乎我必须将文本发送到拾取轮,以使其调整到所需的值。这是我尝试使用的代码: Then(/^I click on month"([^"]*)"$/) do |month_number| find_element(xpath: "//XCUIElementTypePickerWheel[1]").adjustToPickerWheelValue("#{month_

我一直在用Ruby和Cucumber框架自动化一个应用程序。在这个框架内,我正在使用XUITest实现iOS自动化

根据我所做的研究,似乎我必须将文本发送到拾取轮,以使其调整到所需的值。这是我尝试使用的代码:

Then(/^I click on month"([^"]*)"$/) do |month_number|
  find_element(xpath: "//XCUIElementTypePickerWheel[1]").adjustToPickerWheelValue("#{month_number}")
end
通过这段代码,我的Cucumber框架调用该元素的find_元素方法,并尝试将“month_number”值发送到“adjustToPickerWheelValue”方法

尝试使用此方法时收到的错误是标准noMethod错误:

undefined method `adjustToPickerWheelValue' for #<Selenium::WebDriver::Element:0x007f802cda98d8> (NoMethodError)
#的未定义方法“adjustToPickerWheelValue”(命名错误) 在我的env.rb文件中调用这个方法需要做什么特殊的事情吗?现在我只需要“appium_lib”。是否也需要使用XCUITest库


我们将非常感谢您的任何帮助。我对自动化iOS非常陌生。感谢您的阅读,我希望很快收到您的来信。

xcuitest的方法是

select_picker_wheel(element:, order:, offset: nil)

所以我做了更多的研究,似乎他们用一种新方法“SelectPickerHeelValue”解决了这个问题。我现在的问题是,我的自动化环境似乎没有正确地使用该方法。我得到以下错误
未知移动命令“selectpickerheelvalue”。仅支持滚动、滑动、挤压、双击、twoFinterTap、touchAndHold、tap、dragFromToForDuration命令
我的环境中缺少哪些允许我从appium XUITest驱动程序中使用此方法的命令?