运行解锁apk

时间:2017-11-02 09:51:57

标签: java android selenium-webdriver appium

线程中的异常" main" org.openqa.selenium.WebDriverException:处理命令时发生未知的服务器端错误。原始错误:ENOENT:没有这样的文件或目录,scandir' C:\ Users \ Ramoji \ AppData \ Local \ Android \ sdk \ platform-tools \ build-tools' (警告:服务器未提供任何堆栈跟踪信息)命令持续时间或超时:970毫秒

Appium日志:

[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\unlock_apk\\unlock_apk-debug.apk","platformName":"Android","deviceName":"39a104ce"},{},{"desiredCapabilities":{"app":"C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\unlock_apk\\unlock_apk-debug.apk","platformName":"Android","deviceName":"39a104ce"},"requiredCapabilities":{},"alwaysMatch":{"platformName":"Android"},"firstMatch":[]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1509613560405 (14:36:00 GMT+0530 (India Standard Time))
[Appium] Creating new AndroidDriver (v1.20.0) session
[Appium] Capabilities:
[Appium]   app: 'C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\unlock_apk\\unlock_apk-debug.apk'
[Appium]   platformName: 'Android'
[Appium]   deviceName: '39a104ce'
[debug] [AndroidDriver] AndroidDriver version: 1.20.0
[BaseDriver] Session created with session id: 30c58492-0ec2-4399-9800-d5813f05d3d1
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_151
[ADB] Checking whether adb is present
[debug] [AndroidDriver] Shutting down Android driver
[debug] [AndroidDriver] Called deleteSession but bootstrap wasn't active
[MJSONWP] Encountered internal error running command: Error: ENOENT: no such file or directory, scandir 'C:\Users\Ramoji\AppData\Local\Android\sdk\platform-tools\build-tools'
[HTTP] <-- POST /wd/hub/session 500 480 ms - 258

1 个答案:

答案 0 :(得分:0)

请检查您的ANDROID_HOME,因为appium无法找到构建工具:

ANDROID_HOME = C:\ Users \ Ramoji \ AppData \ Local \ Android \ Sdk'

在Path环境中设置位置直到build-tools目录: C:\ Users \用户罗摩吉\应用程序数据\本地\的Android \ SDK \平台工具\构建工具

或%ANDROID_HOME%\ platform-tools \ build-tools。

同时检查Eclipse Eclipse - &gt;运行配置 - &gt; “环境”选项卡是否设置了错误的路径