2016-08-22 98 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文件。现在测试用例正确执行。