我正在尝试运行将app启动到设备的基本appium测试。但我得到错误。我很困惑如何在Android工作室中运行appium测试。[在此输入图像描述] [1]
环境
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 \应用程序数据\本地\ TEMP \ TestNG的-蚀 - 1847523077 \ TestNG的-customsuite.xml[Utils]试图创造 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ Default suite \ Default test.xml [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \默认套件存在: 真失败:开始 org.openqa.selenium.remote.UnreachableBrowserException:不能 开始一个新的会议。可能的原因是遥控器的无效地址 服务器或浏览器启动失败。构建信息:版本:'未知', 修订版:' 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) 在 org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:157) 在demo.StartAppium.start(StartAppium.java:36)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at java.lang.reflect.Method.invoke(未知来源)at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) 在org.testng.internal.Invoker.invokeMethod(Invoker.java:646)at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811)at at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1129)at at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) 在 org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) 在org.testng.TestRunner.privateRun(TestRunner.java:746)at org.testng.TestRunner.run(TestRunner.java:600)at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)at at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)at at org.testng.SuiteRunner.run(SuiteRunner.java:268)at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264)at at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)at 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)引起 by: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.execchain.MainClientExec.execute(MainClientExec.java:236) 在 org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) 在 org.apache.http.impl.execchain.RetryExec.execute(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) 在 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连接(Native 方法)在java.net.DualStackPlainSocketImpl.socketConnect(未知 来自java.net.AbstractPlainSocketImpl.doConnect(未知来源) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) 在java.net.AbstractPlainSocketImpl.connect(未知来源)at java.net.PlainSocketImpl.connect(未知来源)at java.net.SocksSocketImpl.connect(未知来源)at java.net.Socket.connect(未知来源)at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74) 在 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毫秒 [Utils]试图创造 C:\ AndroidDemoworkspace \ StartAppium \测试输出\ TestNG的-failed.xml [Utils]目录C:\ AndroidDemoworkspace \ StartAppium \ test-output exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\默认 suite \ testng-failed.xml [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \默认套件存在: true [TestNG] [FailedReporter传递的时间= 0失败= 0 skipped = 0]:21 ms [TestNG]所用的时间 org.testng.reporters.XMLReporter@48140564:13 ms [Utils]试图 创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\ junitreports \ TEST-demo.StartAppium.xml [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ junitreports存在: true [TestNG]所用的时间 org.testng.reporters.JUnitReportReporter@3b6eb2ec:12 ms [Utils] 试图创造 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ toc.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ Default test.properties [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ index.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ main.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ groups.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ classes.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ reporter-output.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ methods-not-run.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \测试输出\老\ DEFAULT suite \ testng.xml.html [Utils]目录 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ Default suite exists:true [Utils]试图创建 C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old \ index.html [Utils] 目录C:\ AndroidDemoworkspace \ StartAppium \ test-output \ old存在: true [TestNG]所用的时间 org.testng.reporters.SuiteHTMLReporter@1134affc:49 ms [TestNG]时间 由org.testng.reporters.EmailableReporter2@3ac3fd8b采取:7毫秒
答案 0 :(得分:0)
我没有正确添加selenium-server-standalone-3.0.0-beta2.jar和java-client-3.2.0.jar文件。现在测试用例正确执行。