2016-08-22 103 views
0

我想運行啓動apk的設備的基本appium測試。但我收到錯誤。我很困惑如何運行appium考不上的Android工作室[在這裏輸入的形象描述] [1]無法運行第一個appium測試

環境

Appium version (or git revision) that exhibits the issue:Appium v1.4.16 
Last Appium version that did not exhibit the issue (if applicable):NA 
Desktop OS/version used to run Appium: Windows 10 64 bit 
Node.js version (unless using Appium.app|exe):v4.4.7 
Mobile platform/version under test: Android 5.1 
Real device or emulator/simulator: Real Device 
Appium CLI or Appium.app|exe: Appium.exe 

enter image description here enter image description here

[TestNG的]跑步:
C:\ Users \ prabu \ AppData \ Local \ Temp \ testng-eclipse - 1847523077 \ testng-customsuite.xml

[Utils] At誘人的創建 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\默認套件\默認 的test.xml [的Utils]指南 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\默認套件存在: 真FAILED:啓動 有機.openqa.selenium.remote.UnreachableBrowserException:不能 開始一個新的會話。可能的原因是服務器或瀏覽器啓動失敗的遠程地址爲無效的 。構建信息:版本:'unknown', 修訂:'2aa21c1',時間:'2016-08-02 14:59:43 -0700'系統信息: 主機:'Vaibhav-PC',ip:'192.168.0.114 ',os.name:'Windows 10', os.arch:'amd64',os.version:'10.0',java.version:'1.8.0_101'驅動程序 info:driver.version:RemoteWebDriver at org。 openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:670) 在 org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:247) 在 org.openqa.selenium.remote.RemoteWebDriver。 (RemoteWebDriver.java:130) at org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:157) at demo.StartAppium.start(S tartAppium.java:36)維持在在 sun.reflect.DelegatingMethodAccessorImpl.invoke(來源不明) sun.reflect.NativeMethodAccessorImpl.invoke(來源不明) sun.reflect.NativeMethodAccessorImpl.invoke0(本機方法)在 的java.lang .reflect.Method.invoke(來源不明)處 組織 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) 在org.testng.internal.Invoker.invokeMethod(Invoker.java:646)。 testg.internal.Invoker.invokeTestMethod(Invoker.java:811) org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1129)at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) org.te at stng.internal.TestMethodWorker.run(TestMethodWorker.java:112) 在org.testng.TestRunner.privateRun(TestRunner.java:746)處 有機 org.testng.TestRunner.run(TestRunner.java:600)。 testng.SuiteRunner.runTest(SuiteRunner.java:366)在 org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)在 org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)在 org.testng。 SuiteRunner.run在 org.testng.TestNG在 org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)(SuiteRunner.java:268)在 org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)。 runSuitesSequentially(TestNG.java:1264)at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)at org.testng.TestNG.runSuites(TestNG.java:1104)at org.testng.TestNG.run(TestNG.java:1076)at org.testng.remote。AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126) 在org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152) 在org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)引起 由: org.apache.http.conn.HttpHostConnectException:連接到 127.0.0.1:4723 [/127.0.0.1]失敗:連接被拒絕:連接在org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158 ) 在 org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) 在 org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) 在 org.apache.http.impl.execchai n.MainClientExec.execute(MainClientExec.java:236) 在 org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) 在 org.apache.http.impl.execchain.RetryExec。執行(RetryExec.java:88) 在 org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) 在 org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient。的java:184) 在 org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) 在 org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55) at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:142) 在 org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:88) 在 org.openqa。 selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:649) ...... 29多個引起:java.net.ConnectException:連接被拒絕: 在java.net.DualStackPlainSocketImpl.waitForConnect(本地 法)以java.net.DualStackPlainSocketImpl.socketConnect(未知 來源)在java.net.AbstractPlainSocketImpl.doConnect(來源不明) 連接在java.net.Abs (未知來源) java.net.AbstractPlainSocketImpl.connect(未知來源) java.net.PlainSocketImpl.connect(來源不明) java.net.SocksSocketImpl.connect(來源不明) java。 net.Socket.connect(Unknown Source)at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator。 java:141) ... 42更多

==================================== =========== 默認測試

測試運行:1,失敗:1,跳過:0

============================== =================默認套件總測試運行:1,失敗次數:1,跳過:0

[TestNG] org.testng.reporters.jq所用的時間。 Main @ 1b0375b3:38 ms [Utils]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ testng-failed。XML [的Utils]目錄C:\ AndroidDemoworkspace \ StartAppium \測試輸出 存在:真[的Utils]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\默認 套件\ TestNG的-failed.xml [的Utils]目錄 C:\ AndroidDemoworkspace \ StartAppium \ test-output \默認套件存在: true [TestNG]由[FailedReporter傳遞= 0失敗= 0所花費的時間= 0 跳過= 0]:21 ms [TestNG] 組織花費的時間。 [email protected]:13毫秒[的Utils]試圖 創建 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\ junitreports \ TEST-demo.StartAppium.xml [的Utils]指南 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\菊nitreports存在:採取 [email protected] 真[TestNG的]時間:12毫秒[的Utils] 試圖創建 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\老\默認 套件\ TOC .html [Utils] C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \默認test.properties [Utils]目錄 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \默認套件 exists:true [Utils]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite \ index.html [Utils] C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \默認 套房\ main.html中[utils的]目錄 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\老\默認套房 存在:真[utils的]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\老\ Default suite \ groups.html [Utils] Directory C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default套件 exists:true [Utils]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \ test-output \舊\默認 suite \ classes.html [Utils] Directory C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default套件 exists:true [Utils]嘗試創建 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \默認 套房\記者,output.html [utils的]目錄 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\老\默認套房 存在:真[utils的]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\ old \ Default suite \ methods-not-run.html [Utils] Directory C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default套件 exists:true [Utils]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \測試輸出\老\ Defaul t suite \ testng.xml.html [Utils] Directory C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default套件 exists:true [Utils]試圖創建 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ index.html [Utils] 目錄C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old存在: true [TestNG]耗時 [email protected]:49 ms [TestNG] Time 採取[email protected]:7毫秒

+0

分享您在代碼 –

+1

中指定的期望適配性,因爲連接拒絕錯誤正在進行中,所以我相信可能存在期望功能的問題 –

+0

Appium現在工作正常......其實我已經犯了一些錯誤,如添加錯誤的jar文件,環境變量錯誤..謝謝大家回覆我。但我想更多地探索它。建議我演示示例 –

回答

0

我沒有正確添加硒的服務器獨立-3.0.0-beta2.jar和Java的客戶端 - 3.2.0.jar文件。現在測試用例正確執行。