我正在尝试在实际设备(而非本机应用程序)上测试Android网络应用程序。我正在使用Ruby Cucumber Appium Framework
我的Simple_POC.feature文件
Given(/^I log on to the site with the following:$/) do |page|
@driver.get("https://example.com")
p @driver.current_url
@driver.text("Search")
end
当我运行此脚本时-
黄瓜功能\ Simple_POC.feature --tags @wip
我收到以下错误-
invalid argument: Unsupported locator strategy: -android uiautomator
(Session info: chrome=73.0.3683.90)
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 6.1.7601 SP1 x86_64) (Selenium::WebDriver::Error::InvalidArgumentError)
InvalidArgumentError: invalid argument: Unsupported locator strategy: -android uiautomator
(Session info: chrome=73.0.3683.90)
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 6.1.7601 SP1 x86_64)
at errorFromMJSONWPStatusCode (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:786:12)
at ProxyRequestError.errorFromMJSONWPStatusCode [as getActualError] (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:683:14)
at getActualError (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:443:25)
./features/step_definitions/simple_poc_steps.rb:5:in `/^I log on to the site with the following:$/'
features/Simple_POC.feature:18:in `Given I log on to the site with the following:'
我的hooks.rb文件
在做之前 @driver = $驱动程序 @ driver.start_driver 结束
完成后 @ driver.driver.quit 结束
我的env.rb文件
require "appium_lib"
def caps
{caps:
{
# automationName: "uiautomator2",
deviceName: "Android_Device",
platformName: "Android",
browserName: "Chrome",
newCommandTimeout: "3600"
}
}
end
Appium::Driver.new(caps, true)
Appium.promote_appium_methods Object
我在这里想念什么?