簡體   English   中英

在運行Android的Appium測試時出現代理錯誤

[英]Getting Proxy error while running appium test for Android

Environment
- java client build version : 6.1.0 
- Appium server version : 1.7.1 
- Desktop OS/version used to run Appium if necessary: Windows 7 
- Node.js version : 6.4.1 
- Mobile platform/version under test: Android/ 8.1.0 
- Real device or emulator/simulator: Real device 
- Selenium Version: 3.12.0
- TestNg Version : 6.14.3 

當我在運行針對Android的Appium測試時,無法在真實設備上啟動應用程序,導致Appium日志中出現代理錯誤,而在控制台上則出現無法創建新會話的錯誤。

如果需要,是否需要任何網絡設置,請指導需要設置哪種設置。

Code To Reproduce Issue [ Good To Have ] 
public class launchApp {
AndroidDriver<WebElement> driver;

@BeforeClass
public void beforeClass() throws MalformedURLException, InterruptedException {
    DesiredCapabilities capab = new DesiredCapabilities();

    capab.setCapability("deviceName", "Redmi Note 5");
    capab.setCapability("udid", "35924c6f0804");
    capab.setCapability("platformName", "Android");
     capab.setCapability("automationName", "UiAutomator2");
    capab.setCapability("platformVersion", "8.1.0");
    capab.setCapability("appPackage", "com.miui.calculator");
    capab.setCapability("appActivity", "com.miui.calculator.cal.CalculatorActivity");
    driver = new AndroidDriver<WebElement>(new URL("http://0.0.0.0:4723/wd/hub"), capab);

     Thread.sleep(5000);
}

@Test
public void m1() throws InterruptedException {
    System.out.println("kfd");
    Thread.sleep(2000);

}
}

Console Exception:
org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it is not accessible
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'

Appium服務器日志:

 [info] [35m[Appium][39m Welcome to Appium v1.9.1 [info] [35m[Appium][39m Non-default server args: [info] [35m[Appium][39m sessionOverride: true [info] [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723[info] [35m[HTTP][39m [37m-->[39m 

[37mPOST [39m [37m / wd / hub / session [39m [info] [35m [HTTP] [39m [90m {“ desiredCapabilities”:{“ appActivity”:“ com.miui.calculator.cal.CalculatorActivity”,“ appPackage “:” com.miui.calculator”, “platformVersion”: “8.1.0”, “automationName”: “UiAutomator2”, “platformName”: “機器人”, “設備名”: “35924c6f0804”}, “能力”:{ “alwaysMatch”:{ “appium:appActivity”: “com.miui.calculator.cal.CalculatorActivity”, “appium:appPackage”: “com.miui.calculator”, “appium:automationName”: “UiAutomator2”,“appium: deviceName“:” 35924c6f0804“,” platformName“:” android“,” appium:platformVersion“:” 8.1.0“},” firstMatch“:[{}]}} [39m [debug] [35m [W3C] [39m使用args調用AppiumDriver.createSession():[{“ appActivity”:“ com.miui.calculator.cal.CalculatorActivity”,“ appPackage”:“ com.miui.calculator”,“ platformVersion”:“ 8.1.0”,“ automationName “:” UiAutomator2" , “platformName”: “機器人”, “設備名”: “35924c6f0804”},空,{ “alwaysMatch”:{ “appium:appActivity”: “com.miui.calculator.cal.CalculatorActivity”, “appium:appPackage”: “com.miui.calculator”,“應用程序 鎓:automationName “:” UiAutomator2" , “appium:設備名”: “35924c6f0804”, “platformName”: “機器人”, “appium:platformVersion”: “8.1.0”}, “firstMatch”:[{}]}] [調試] [35m [BaseDriver] [39m事件'newSessionRequested',記錄為1540389852349(格林尼治標准時間+0530(印度標准時間)19:34:12))[信息] [35m [Appium] [39m創建新的AndroidUiautomator2Driver(v1.19.0)會話[info] [35m [Appium] [39m]功能:[info] [35m [Appium] [39m platformName:android [info] [35m [Appium] [39m appActivity:com.miui.calculator.cal.CalculatorActivity [info] [35m [Appium] [39m appPackage:com.miui.calculator [info] [35m [Appium] [39m automationName:UiAutomator2 [info] [35m [Appium] [39m deviceName:35924c6f0804 [info] [35m [Appium] [39m platformVersion:8.1.0 [調試] [35m [BaseDriver] [39m W3C功能{“ alwaysMatch”:{“ platformNa ...和MJSONWP所需的功能{” appActivity“:” com.miui.ca ...已提供[調試] [35m [BaseDriver] [39m創建具有W3C功能的會話:{“ alwaysMatch”:{“ platformNa ... [info] [35m [BaseDriver] [使用會話ID創建的39m會話:fe068491-4817-474e-bcd5-6580d8909142 [info] [35m [AndroidDriver] [39m Java版本是:1.8.0_91 [info] [35m [AndroidDriver] [39m檢索設備列表[debug] [35m [ADB] [39m試圖找到連接的android設備[調試] [35m [ADB] [39m正在獲取連接的設備... [調試] [35m [ADB] [39m 1已連接的設備[信息] [ 35m [AndroidDriver] [39m尋找裝有Android'8.1.0'的設備[調試] [35m [ADB] [39m將設備ID設置為35924c6f0804] [信息] [35m [ADB] [39m獲取設備平台版本[調試] [ 35m [ADB] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell getprop ro.build.version.release'[[調試] [ 35m [ADB] [39m當前設備屬性'ro.build.version.release':8.1.0 [info] [35m [AndroidDriver] [39m使用設備:35924c6f0804 [debug] [35m [ADB] [39m設置設備ID為35924c6f0804 [debug] [35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 sh ell getprop ro.build.version.sdk'[調試] [35m [ADB] [39m當前設備屬性'ro.build.version.sdk':27 [調試] [35m [ADB] [39m設備API級別:27 [警告] [35m [AndroidDriver] [39m未發送任何應用程序,未解析包/活動[信息] [35m [ADB] [39m正在獲取設備平台版本] [調試] [35m [ADB] [39m正在運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell getprop ro.build.version.release'[debug] [35m [ADB] [39m當前設備屬性'ro.build .version.release':8.1.0 [debug] [35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell wm size'[debug] [35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell wm density'[debug] [35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell getprop ro.product.model'[調試] [35m [ADB] [39m當前設備屬性'ro.product.mo del':Redmi注意事項5 [debug] [35m [ADB] [39m正在運行C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell getprop ro。 product.manufacturer'[debug] [35m [ADB] [39m當前設備屬性'ro.product.manufacturer':Xiaomi [debug] [35m [ADB] [39m Device API level:27 [debug] [35m [ADB] [ 39m運行“ C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell強制停止io.appium.uiautomator2.server” [調試] [35m [ ADB] [39m檢查C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2-server \\ apks \\ appium-uiautomator2-server-v1.18.0的應用程序證書.apk [debug] [35m [ADB] [39m],以'[“ verify”,“開頭的C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ build-tools \\ 28.0.3 \\ apksigner.bat' --print-證書 “” C:\\用戶\\辦公\\應用程序數據\\本地\\程序\\ appium \\資源\\程序\\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2服務器\\的APK \\ appium-uiautomator2-服務器v1.18.0 .apk“]'[debug] [ 35m [ADB] [39m apksigner標准輸出:簽署人#1證書DN:EMAILADDRESS = android @ android.com,CN = Android,OU = Android,O = Android,L =山景,ST =加利福尼亞,C =美國[調試] [35m [ADB] [39m簽署者#1證書SHA-256摘要:a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [調試] [35m [ADB] [39m簽署者#1證書SHA-1摘要:61ed377e85d386a8dfee6bfad1a [5a1a]證書MD5摘要:e89b158e4bcf988ebd09eb83f5378e87 [debug] [35m [ADB] [39m]警告:META-INF / INDEX.LIST不受簽名保護。 將不會檢測到對此JAR條目的未經授權的修改。 刪除條目或將其移到META-INF /之外。 [調試] [35m [ADB] [39m]警告:META-INF / io.netty.versions.properties不受簽名保護。 將不會檢測到對此JAR條目的未經授權的修改。 刪除條目或將其移到META-INF /之外。 [調試] [35m [ADB] [39m [調試] [35m [ADB] [39m'C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2- server \\ apks \\ appium-uiautomator2-server-v1.18.0.apk'已簽名。 [調試] [35m [ADB] [39m]檢查C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2-server \\ apks \\ appium-uiautomator2的應用程序證書-server-debug-androidTest.apk [debug] [35m [ADB] [39m]使用args'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ build-tools \\ 28.0.3 \\ apksigner.bat' [ “驗證”, “ - 打印證書”,“C:\\用戶\\辦公\\應用程序數據\\本地\\程序\\ appium \\資源\\程序\\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2服務器\\的APK \\ appium,uiautomator2 -server-debug-androidTest.apk“]'[debug] [35m [ADB] [39m apksigner stdout:簽署人#1證書DN:EMAILADDRESS = android @ android.com,CN = Android,OU = Android,O = Android, L =山景城,ST =加利福尼亞,C =美國[調試] [35m [ADB] [39m簽署者#1證書SHA-256摘要:a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc [調試] [35m [ADB] [39m簽署者#1證書:61ed377e85d386a8dfee6b864bd85b0bfaa5af81 [debug] [35m [ADB] [39m Signer#1證書MD5摘要:e89b158e 4bcf988ebd09eb83f5378e87 [debug] [35m [ADB] [39m [debug] [35m [ADB] [39m'C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2 -server \\ apks \\ appium-uiautomator2-server-debug-androidTest.apk'已簽名。 [調試] [35m [ADB] [39m]獲取io.appium.uiautomator2.server的安裝狀態[調試] [35m [ADB] [39m正在運行C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform- tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm列出軟件包io.appium.uiautomator2.server'[debug] [35m [ADB] [39m已安裝應用程序[debug] [35m [ADB] [39m]獲取軟件包信息'io.appium.uiautomator2.server'[調試] [35m [ADB] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell dumpsys軟件包io.appium.uiautomator2.server'[調試] [35m [ADB] [39m]已安裝的io.appium.uiautomator2.server軟件包不需要升級('1.18.0'> ='1.18.0') [調試] [35m [ADB] [39m]獲取io.appium.uiautomator2.server.test的安裝狀態[調試] [35m [ADB] [39m正在運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm列表包io.appium.uiautomator2.server.test'[debug] [35m [ADB] [39m已安裝應用程序[debug] [35m [ADB] [39m獲得pac io.appium.uiautomator2.server.test的kage信息[調試] [35m [ADB] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell dumpsys程序包io.appium.uiautomator2.server.test'[警告] [35m [ADB] [39m無法讀取'C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2-server \\ apks \\ appium-uiautomator2-server-debug-androidTest.apk'和/或'io.appium.uiautomator2.server.test'[警告] [35m [ADB] [39m無法讀取'C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2-server \\ apks \\ appium-uiautomator2-server-debug-androidTest的版本名稱.apk”和/或“ io.appium.uiautomator2.server.test”。 假設已經安裝了正確的應用程序版本[調試] [35m [UiAutomator2] [39m等待長達20000ms的檢測'io.appium.uiautomator2.server.test / android.support.test.runner.AndroidJUnitRunner”可用[調試] [35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm list instrumentation” [調試] [35m [UiAutomator2] [39m Instrumentation'io.appium.uiautomator2.server.test / android.support.test.runner.AndroidJUnitRunner'可用[調試] [35m [ADB] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804等待設備'[調試] [35m [ADB] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform- tools \\ adb.exe -P 5037 -s 35924c6f0804 shell echo ping'[調試] [35m [AndroidDriver] [39m將設置apk推送到設備... [調試] [35m [ADB] [39m]獲取io.appium的安裝狀態.settings [debug] [35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platf orm-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm列表包io.appium.settings'[debug] [35m [ADB] [39m未安裝應用程序[debug] [35m [ADB] [39m App'C :未安裝:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ io.appium.settings \\ app \\ build \\ outputs \\ apk \\ settings_apk-debug.apk'。 安裝[調試] [35m [ADB] [39m設備API級別:27 [調試] [35m [ADB] [39m運行C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804安裝-g C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ io.appium.settings \\ app \\ build \\ outputs \\ apk \\ settings_apk- debug.apk'[調試] [35m [ADB] [39m安裝命令標准輸出:成功[調試] [35m [ADB] [39m運行C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell ps'[調試] [35m [ADB] [39m設備API級別:27 [調試] [35m [ADB] [39m正在運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell am start -W -n io.appium.settings / .Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'[debug] [35m [ADB] [39m Device API level:27 [debug] [35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell appops設置io .appium.settings android:mock_location allow'[警告] [35m [AndroidDriver] [39m setDeviceLanguageCountry需要語言或國家/地區。 [警告] [35m [AndroidDriver] [39m]獲得的語言:“未定義”和國家/地區:“未定義” [調試] [35m [Logcat] [39m]啟動logcat捕獲[調試] [35m [AndroidDriver] [39m]將解鎖助手應用推送到設備... [調試] [35m [ADB] [39m]獲取io.appium.unlock的安裝狀態[調試] [35m [ADB] [39m正在運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm列表軟件包io.appium.unlock'[debug] [35m [ADB] [39m未安裝應用程序[debug] [35m [ADB] [39m App'C :未安裝\\\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-unlock \\ bin \\ unlock_apk-debug.apk'。 安裝[調試] [35m [ADB] [39m設備API級別:27 [調試] [35m [ADB] [39m運行C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804安裝-g C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-unlock \\ bin \\ unlock_apk-debug.apk'[[debug] [ 35m [ADB] [39m安裝命令標准輸出:成功[調試] [35m [UiAutomator2] [39m轉發UiAutomator2服務器端口6790至8200 [debug] [35m [ADB] [39m轉發系統:8200至設備:6790 [debug] [ 35m [ADB] [39m Running'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 forward tcp:8200 tcp:6790'[debug] [35m [亞行] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell rm -rf /data/local/tmp/strings.json'[調試] [35m [ADB] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm path com.miui.calculator'[調試] [35m [ADB] [39m Ru n'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 pull /system/app/Calculator/Calculator.apk C:\\ Users \\ Office \\ AppData \\ Local \\ Temp \\ com.miui.calculator.apk'[debug] [35m [ADB] [39m]將包“ com.miui.calculator”的應用拉到“ C:\\ Users \\ Office \\ AppData \\ Local \\ Temp \\ com”。 miui.calculator.apk'[調試] [35m [AndroidDriver] [39m]從apk提取字符串[調試] [35m [AndroidDriver] [39m C:\\ Users \\ Office \\ AppData \\ Local \\ Temp \\ com.miui.calculator.apk [調試] [35m [AndroidDriver] [39m未定義[調試] [35m [AndroidDriver] [39m C:\\ Users \\ Office \\ AppData \\ Local \\ Temp \\ com.miui.calculator [調試] [35m [ADB] [39m提取語言字符串:default [info] [35m [ADB] [39m]從“ C:\\ Users \\ Office \\ AppData \\ Local \\ Temp \\ com.miui.calculator.apk”資源中成功提取了645個字符串,用於“(默認)”配置[調試] [35m [ADB] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 push C:\\ Users \\ Office \\ AppData \\本地的\\ Temp \\ com.miui .calculator \\ strings.json / data / local / tmp'[調試] [35m [UiAutomator2] [39m沒有應用功能。 假設它已經在設備上[調試] [35m [ADB] [39m]獲取com.miui.calculator的安裝狀態[調試] [35m [ADB] [39m]運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ SDK \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm列表包com.miui.calculator'[debug] [35m [ADB] [39m已安裝應用程序[debug] [35m [ADB] [39m正在運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell am force-stop com.miui.calculator'[調試] [35m [ADB] [39m運行“ C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell pm clear com.miui.calculator” [調試] [35m [AndroidDriver] [39m執行在已安裝的“ com.miui.calculator”應用程序上快速重置(停止並清除)[debug] [35m [ADB] [39m檢查應用程序證書中的未定義[debug] [35m [ADB] [39m正在運行C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 shell強制停止io.appium.uiautomator2.server'[info] [35m [UiAutomator2] [39m St arting uiautomator2服務器1.18.0 [info] [35m [UiAutomator2] [39m]從'C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2-使用UIAutomator2服務器server \\ apks \\ appium-uiautomator2-server-v1.18.0.apk'並從'C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-uiautomator2-server測試\\ apks \\ appium-uiautomator2-server-debug-androidTest.apk'[信息] [35m [UiAutomator2] [39m運行命令:'adb -s 35924c6f0804 shell am instrument -w io.appium.uiautomator2.server.test / android。 support.test.runner.AndroidJUnitRunner'[info] [35m [UiAutomator2] [39m等待最長20000ms以便UiAutomator2聯機... [調試] [35m [JSONWP代理] [39m將'/ status'匹配到命令名' getStatus'[debug] [35m [JSONWP Proxy] [39m Proxy [GET / status] to [GET http:// localhost:8200 / wd / hub / status]沒有正文[錯誤] [35m [UiAutomator2] [39m [ UIAutomator2錯誤] getaddrinfo ENOENT本地主機本地主機:5037 [debu g] [35m [UiAutomator2] [39m Full error:Error:getaddrinfo ENOENT localhost localhost:5037 [debug] [35m [UiAutomator2] [39m at GetAddrInfoReqWrap.onlookup [as oncomplete](dns.js:50:26)[debug] [35m [JSONWP代理] [39m將'/ status'與命令名'getStatus'匹配[調試] [35m [JSONWP代理] [39m代理[GET / status]到[GET http:// localhost:8200 / wd / hub / status]沒有正文[debug] [35m [JSONWP Proxy] [39m]將'/ status'與命令名'getStatus'相匹配[debug] [35m [JSONWP Proxy] [39m Proxying [GET / status] to [GET http: //沒有主體的localhost:8200 / wd / hub / status] [debug] [35m [JSONWP Proxy] [39m將'/ status'與命令名'getStatus'相匹配[debug] [35m [JSONWP Proxy] [39m Proxying [ GET / status]到[GET http:// localhost:8200 / wd / hub / status]沒有主體[調試] [35m [JSONWP代理] [39m將'/ status'匹配到命令名稱'getStatus'[調試] [ 35m [JSONWP代理] [39m將[GET / status]代理到[GET http:// localhost:8200 / wd / hub / status] ,沒有正文[調試] [35m [JSONWP代理] [39m將'/ status'匹配為命令名稱'g etStatus的[調試] [35m [JSONWP代理] [39m]將沒有實體的[GET / status]代理到[GET http:// localhost:8200 / wd / hub / status] [調試] [35m [JSONWP代理] [39m將'/ status'與命令名'getStatus'匹配[調試] [35m [JSONWP代理] [39m代理[GET / status]到[GET http:// localhost:8200 / wd / hub / status] ,沒有正文[調試] ] [35m [JSONWP代理] [39m將'/ status'與命令名'getStatus'匹配[調試] [35m [JSONWP代理] [39m代理[GET / status]到[GET http:// localhost:8200 / wd / hub / status]沒有主體[debug] [35m [JSONWP Proxy] [39m]將'/ status'與命令名'getStatus'相匹配[debug] [35m [JSONWP Proxy] [39m Proxying [GET / status] to [GET http ://:// localhost:8200 / wd / hub / status]沒有主體[調試] [35m [JSONWP代理] [39m將'/ status'與命令名'getStatus'匹配[調試] [35m [JSONWP代理] [39m代理[GET / status]到[GET http:// localhost:8200 / wd / hub / status]沒有主體[調試] [35m [JSONWP代理] [39m將'/ status'匹配到命令名稱'getStatus'[調試] [35m [JSONWP Proxy] [39m Proxying [GET / stat 我們]到[GET http:// localhost:8200 / wd / hub / status]沒有正文[調試] [35m [JSONWP代理] [39m將'/ status'匹配到命令名稱'getStatus'[調試] [35m [ JSONWP代理] [39m將[GET / status]代理到[GET http:// localhost:8200 / wd / hub / status] ,沒有正文[調試] [35m [JSONWP代理] [39m將'/ status'匹配到命令名稱'getStatus'[debug] [35m [JSONWP Proxy] [39m Proxy [GET / status] to [GET http:// localhost:8200 / wd / hub / status]沒有主體[debug] [35m [JSONWP Proxy] [ 39m將'/ status'與命令名'getStatus'匹配[調試] [35m [JSONWP代理] [39m代理[GET / status]到[GET http:// localhost:8200 / wd / hub / status] ,沒有正文[調試] [35m [JSONWP代理] [39m將'/ status'與命令名稱'getStatus'匹配[調試] [35m [JSONWP代理] [39m代理[GET / status]到[GET http:// localhost:8200 / wd / hub / status]沒有主體[調試] [35m [JSONWP代理] [39m將'/ status'與命令名'getStatus'匹配[調試] [35m [JSONWP代理] [39m代理[GET / status]到[GET http:// localhost:8200 / wd / hub / status] ,沒有bod y [debug] [35m [JSONWP Proxy] [39m將'/ status'匹配到命令名稱'getStatus'[debug] [35m [JSONWP Proxy] [39m Proxying [GET / status]到[GET http:// localhost:8200 / wd / hub / status]沒有主體[調試] [35m [JSONWP代理] [39m]將“ / status”與命令名“ getStatus”匹配[調試] [35m [JSONWP代理] [39m代理[GET / status] [GET http:// localhost:8200 / wd / hub / status]沒有主體[調試] [35m [JSONWP代理] [39m將'/ status'與命令名'getStatus'匹配[調試] [35m [JSONWP代理] [39m將[GET / status]代理到[GET http:// localhost:8200 / wd / hub / status] ,沒有正文[調試] [35m [JSONWP代理] [39m將'/ status'匹配到命令名稱'getStatus' [debug] [35m [JSONWP Proxy] [39m Proxy [GET / status] to [GET http:// localhost:8200 / wd / hub / status]沒有主體[debug] [35m [UiAutomator2] [39m刪除UiAutomator2會話[調試] [35m [UiAutomator2] [39m刪除UiAutomator2服務器會話] [調試] [35m [JSONWP代理] [39m將'/'匹配到命令名稱'deleteSession'[警告] [35m [UiAutomator2] [39m沒有得到 確認UiAutomator2 deleteSession是否工作; 錯誤為:UnknownError:處理命令時發生未知的服務器端錯誤。 原始錯誤:嘗試代理沒有會話ID的會話命令[調試] [35m [ADB] [39m正在運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037- s 35924c6f0804 shell強制停止com.miui.calculator'[debug] [35m [Logcat] [39m停止logcat捕獲[debug] [35m [ADB] [39m]刪除轉發的端口套接字連接:8200 [debug] [35m [ADB] ] [39m運行'C:\\ Users \\ Office \\ AppData \\ Local \\ Android \\ Sdk \\ platform-tools \\ adb.exe -P 5037 -s 35924c6f0804 forward --remove tcp:8200'[調試] [35m [BaseDriver] [ 39m事件“ newSessionStarted”記錄為1540389906576(19:35:06 GMT + 0530(印度標准時間))[調試] [35m [W3C] [39m遇到內部錯誤運行命令:UnknownError:處理時發生未知的服務器端錯誤命令。 原始錯誤:無法將命令代理到遠程服務器。 原始錯誤:錯誤:getaddrinfo ENOENT localhost localhost:8200 [debug] [35m [W3C] [39m at JWProxy.command $(C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ appium-base-driver \\ lib \\ jsonwp-proxy \\ proxy.js:238:13)[調試] [35m [W3C] [39m at tryCatch(C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ babel-runtime \\ regenerator \\ runtime.js:67:40)[debug] [35m [W3C] [39m at GeneratorFunctionPrototype.invoke [作為_invoke](C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ babel-runtime \\ regenerator \\ runtime.js:315:22)[debug] [35m [W3C] [39m at GeneratorFunctionPrototype.prototype。(匿名函數)[拋出](C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_modules \\ appium \\ node_modules \\ babel-runtime \\ regenerator \\ runtime.js:100:21)[debug] [35m [W3C] [39m at GeneratorFunctionPrototype.invoke(C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ node_mod ules \\ appium \\ node_modules \\ babel-runtime \\ regenerator \\ runtime.js:136:37)[調試] [35m [W3C] [39m運行時(C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ webpack:\\〜\\ babel-polyfill \\〜\\ core-js \\ modules \\ es6.promise.js:75:1)[debug] [35m [W3C] [39m at C:\\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ webpack:\\〜\\ babel-polyfill \\〜\\ core-js \\ modules \\ es6.promise.js:92:1 [debug] [35m [W3C] [39m at flush(C: \\ Users \\ Office \\ AppData \\ Local \\ Programs \\ Appium \\ resources \\ app \\ webpack:\\〜\\ babel-polyfill \\〜\\ core-js \\ modules_microtask.js:18:1)[調試] [35m [W3C] [39m at process._tickCallback(internal / process / next_tick.js:61:11)[info] [35m [HTTP] [39m [37m <-POST / wd / hub / session [39m [31m500 [39m [90m54260 ms-1973] [39m [info] [35m [HTTP] [39m [90m [39m

PLZ指南

  1. 確保您使用的是最新的Appium服務器1.9.1。

  2. 已安裝最新的Android SDK和ADB。

  3. 卸載應用程序,Appium設置並從設備解鎖應用程序。

  4. 設備上已啟用USB調試。

編輯:

我今天也遇到了這個錯誤。

經過分析,我發現我的連接設備離線。

我檢查了以下命令:

$ adb devices

這是離線設備的結果:

List of devices attached
392edea50404    offline

解:

解決的辦法就是我從計算機上拔下設備的插頭,然后重新連接。

試試這種方法,讓我知道。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM