我一直在尝试建立一个Protractor-Cucumber框架,我打算在其中包含appium功能。为此,我目前正在尝试使用Typescript语言将android设备连接到Visual Studio代码。但是启动我的appium服务器并运行npm脚本后,出现以下错误。
> [email protected] test C:\Users...\Documents\autobots-protractor
> protractor typeScript/config/config.js
[12:51:39] I/launcher - Running 1 instances of WebDriver
[12:51:39] I/hosted - Using the selenium server at http://localhost:4723/wd/hub
[12:51:51] E/runner - Unable to start a WebDriver session.
[12:51:51] E/launcher - Error: UnsupportedOperationError: Not implemented yet for script.
at Object.checkLegacyResponse (C:\Users\...\Documents\autobots-protractor\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\Users\...\Documents\autobots-protractor\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\Users\...\Documents\autobots-protractor\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
[12:51:51] E/launcher - Process exited with error code 100
npm ERR! Test failed. See above for more details.
我的配置文件如下:
const phone ={
browserName: '',
platformName: 'Android',
platformVersion:'10',
deviceName: 'xyz',
app:'C:\\Users\\....\\Documents\\autobots-protractor\\App\\LGCalculator.apk',
appPackage: 'com.android.calculator2',
appActivity:'com.android.calculator2.Calculator',
udid: 'SFD3Y184ahsdcj24',
automationName: 'UiAutomator2',
}
export const config: Config = {
seleniumAddress:"http://localhost:4723/wd/hub",baseUrl:"https://www.google.com",
multiCapabilities:[phone],
framework: "custom",
frameworkPath: require.resolve("protractor-cucumber-framework"),
specs: [
"../../features/*.feature",
],
services:{
appium: {
waitStartTime: 6000,
waitforTimeout: 30 * 60000,
command: 'appium',
logFileName: 'appium.log',
args: {
address: 'http://0.0.0.0:4723/wd/hub',
port: 4723,
commandTimeout: 30 * 60000,
sessionOverride: true,
debugLogSpacing: true,
},
},
},
}