【问题标题】:Appium test doesn't even start on AWS DeviceFarmAppium 测试甚至没有在 AWS DeviceFarm 上启动
【发布时间】:2023-04-01 01:59:02
【问题描述】:

我在 iOS 设备上为我的应用运行了一些 iOS Appium 测试 (Java TestNG)。

有些测试甚至没有在 22 台设备中的 6 台或 7 台上安装该应用。所有关于不创建会话的完全相同的错误:

Trying to execute simple Appium Driver
Failed to invoke configuration method scenarios.ScreenshotsAppiumTest.setUp:
It is impossible to create a new session because 
'createSession' which takes HttpClient, 
InputStream and long was not found or it is not accessible

该测试在我的所有设备以及 AWS Device Farm 上的几乎所有其他设备上运行并通过。 在那些失败的设备中,它什么也不做。它不会安装应用程序。

我不知道如何调试这个测试或者为什么它们没有运行。谷歌没有帮助。

我肯定测试有效,因为它适用于其他设备。

我想知道如何调试或尝试解决此错误。调试 Appium 未在 AWS Device Farm 上安装应用程序的步骤是什么? 我能做些什么?是否有任何命令可以执行以获取更多日志?任何事物? 我在 AWS 论坛上问过同样的问题,但没有任何运气...... 谢谢。

我在日志中有这个错误:

RUNNING: Suite: "test" containing "1" Tests (config: /private/tmp/scratchudZ8pO.scratch/testng_xml93e7D5/screenshotsTest.xml)
https://forums.aws.amazon.com/ Keeping method ScreenshotsAppiumTest.setUp()pri:0, instance:scenarios.ScreenshotsAppiumTest@4e04a765 for class http://TestClass name=class scenarios.ScreenshotsAppiumTest
https://forums.aws.amazon.com/ Invoking @BeforeClass ScreenshotsAppiumTest.setUp()pri:0, instance:scenarios.ScreenshotsAppiumTest@4e04a765
INVOKING CONFIGURATION: "test" - @BeforeClass scenarios.ScreenshotsAppiumTest.setUp()
Trying to execute simple Appium Driver
Failed to invoke configuration method scenarios.ScreenshotsAppiumTest.setUp: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.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'prod-osx-device-host-master-v18.local', ip: 'fe80:0:0:0:82:486b:ed14:4cef%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.2', java.version: '1.8.0_141'
Driver info: driver.version: AppiumDriver
FAILED CONFIGURATION: "test" - @BeforeClass scenarios.ScreenshotsAppiumTest.setUp() finished in 0 ms
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.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'prod-osx-device-host-master-v18.local', ip: 'fe80:0:0:0:82:486b:ed14:4cef%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.2', java.version: '1.8.0_141'
Driver info: driver.version: AppiumDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:182)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:196)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:94)
at scenarios.TestSetup.prepareDriver(TestSetup.java:117)
at scenarios.ScreenshotsAppiumTest.setUp(ScreenshotsAppiumTest.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.TestNG.privateMain(TestNG.java:1364)
at org.testng.TestNG.main(TestNG.java:1333)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:172)
... 35 more
Caused by: java.io.IOException: unexpected end of stream on Connection{127.0.0.1:4723, proxy=DIRECT hostAddress=/127.0.0.1:4723 cipherSuite=none protocol=http/1.1}
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:205)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:105)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
... 40 more
Caused by: java.io.EOFException: \n not found: limit=0 content=…
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:227)
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:212)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
... 57 more
INVOKING: "test" - scenarios.ScreenshotsAppiumTest.screenshotsTest()
SKIPPED: "test" - scenarios.ScreenshotsAppiumTest.screenshotsTest() finished in 0 ms
browses the page the title
https://forums.aws.amazon.com/ Keeping method ScreenshotsAppiumTest.tearDown()pri:0, instance:scenarios.ScreenshotsAppiumTest@4e04a765 for class http://TestClass name=class scenarios.ScreenshotsAppiumTest
SKIPPED CONFIGURATION: "test" - @AfterClass scenarios.ScreenshotsAppiumTest.tearDown() finished in 0 ms

【问题讨论】:

  • 你也可以发布appium服务器输出吗?那应该有潜在的错误。
  • 发现 GitHub 问题,错误相同。 github.com/appium/java-client/issues/926我没有复制这个,但看起来这可能是由appium的java客户端引起的。你也可以添加pom文件吗?可能有一些本地测试有但设备主机没有的东西。
  • 你使用的是哪个java版本和java appium客户端版本?另外,你能把测试工作的设备和失败的设备放在一起,以便我重现问题吗?
  • java 客户端的这个方法有错误。 github.com/appium/java-client/blob/master/src/main/java/io/… 进一步研究..
  • 看起来一些提交刚刚与 appium java 客户端使用的 okhttp 客户端合并。 github.com/appium/java-client/pull/928 这可能与该错误与正在创建的会话有关。您能否更新您的 java 客户端,如果问题仍然存在,请告诉我?

标签: ios amazon-web-services appium aws-device-farm


【解决方案1】:

更新。我找到了有这个问题的设备。好像发生在

Apple iPad 2 iOS version 9
Apple iPad Air 2 iOS version 9
Apple iPad Mini 1st Gen iOS version 9
Apple iPad Mini 3 
Apple iPad Pro 9.7" iOS version 10
Apple iPhone 5s iOS version 9
Apple iPhone 7 Plus iOS version 10

在 iOS 版本 9 上。我并不太担心它,因为它看起来像一个版本问题。在未来的研究和检查其他版本之前,我接受我自己的答案。

以下是一台设备的日志以供将来参考:

[TestNG] RUNNING: Suite: "test" containing "1" Tests (config: /tmp/scratchK72Ot0.scratch/testng_xmlK427pl/second_login_is_much_faster.xml)
[Invoker 310656974] Keeping method LoginDurationAppiumTest.setUp()[pri:0, instance:scenarios.LoginDurationAppiumTest@64616ca2] for class [TestClass name=class scenarios.LoginDurationAppiumTest]
[Invoker 310656974] Invoking @BeforeClass LoginDurationAppiumTest.setUp()[pri:0, instance:scenarios.LoginDurationAppiumTest@64616ca2]
[TestNG] INVOKING CONFIGURATION: "test" - @BeforeClass scenarios.LoginDurationAppiumTest.setUp()
Trying to execute simple Appium Driver
Failed to invoke configuration method scenarios.LoginDurationAppiumTest.setUp: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.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'ip-172-31-13-65', ip: '172.31.13.65', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-139-generic', java.version: '1.8.0_151'
Driver info: driver.version: AppiumDriver
[TestNG] FAILED CONFIGURATION: "test" - @BeforeClass scenarios.LoginDurationAppiumTest.setUp() finished in 0 ms
[TestNG] 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
[TestNG] Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
[TestNG] System info: host: 'ip-172-31-13-65', ip: '172.31.13.65', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-139-generic', java.version: '1.8.0_151'
[TestNG] Driver info: driver.version: AppiumDriver
[TestNG]    at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:182)
[TestNG]    at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:196)
[TestNG]    at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)
[TestNG]    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
[TestNG]    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
[TestNG]    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
[TestNG]    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:207)
[TestNG]    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130)
[TestNG]    at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
[TestNG]    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84)
[TestNG]    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:94)
[TestNG]    at scenarios.TestSetup.prepareDriver(TestSetup.java:119)
[TestNG]    at scenarios.LoginDurationAppiumTest.setUp(LoginDurationAppiumTest.java:46)
[TestNG]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[TestNG]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[TestNG]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[TestNG]    at java.lang.reflect.Method.invoke(Method.java:498)
[TestNG]    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
[TestNG]    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
[TestNG]    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
[TestNG]    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
[TestNG]    at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)
[TestNG]    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)
[TestNG]    at org.testng.TestRunner.privateRun(TestRunner.java:767)
[TestNG]    at org.testng.TestRunner.run(TestRunner.java:617)
[TestNG]    at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
[TestNG]    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
[TestNG]    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
[TestNG]    at org.testng.SuiteRunner.run(SuiteRunner.java:254)
[TestNG]    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
[TestNG]    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
[TestNG]    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
[TestNG]    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
[TestNG]    at org.testng.TestNG.run(TestNG.java:1057)
[TestNG]    at org.testng.TestNG.privateMain(TestNG.java:1364)
[TestNG]    at org.testng.TestNG.main(TestNG.java:1333)
[TestNG] Caused by: java.lang.reflect.InvocationTargetException
[TestNG]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[TestNG]    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[TestNG]    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[TestNG]    at java.lang.reflect.Method.invoke(Method.java:498)
[TestNG]    at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:172)
[TestNG]    ... 35 more
[TestNG] Caused by: java.io.IOException: unexpected end of stream on Connection{127.0.0.1:4723, proxy=DIRECT hostAddress=/127.0.0.1:4723 cipherSuite=none protocol=http/1.1}
[TestNG]    at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:205)
[TestNG]    at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[TestNG]    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[TestNG]    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[TestNG]    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[TestNG]    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[TestNG]    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[TestNG]    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
[TestNG]    at okhttp3.RealCall.execute(RealCall.java:77)
[TestNG]    at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:105)
[TestNG]    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
[TestNG]    ... 40 more
[TestNG] Caused by: java.io.EOFException: \n not found: limit=0 content=…
[TestNG]    at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:227)
[TestNG]    at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:212)
[TestNG]    at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
[TestNG]    ... 57 more
[TestNG] INVOKING: "test" - scenarios.LoginDurationAppiumTest.second_login_is_much_faster()
[TestNG] SKIPPED: "test" - scenarios.LoginDurationAppiumTest.second_login_is_much_faster() finished in 10 ms
[TestNG]          Checks if the second time the app logs in is much faster
[Invoker 310656974] Keeping method LoginDurationAppiumTest.tearDown()[pri:0, instance:scenarios.LoginDurationAppiumTest@64616ca2] for class [TestClass name=class scenarios.LoginDurationAppiumTest]
[TestNG] SKIPPED CONFIGURATION: "test" - @AfterClass scenarios.LoginDurationAppiumTest.tearDown() finished in 0 ms
===== Invoked methods
  LoginDurationAppiumTest.setUp()[pri:0, instance:scenarios.LoginDurationAppiumTest@64616ca2] 1684106402
    LoginDurationAppiumTest.second_login_is_much_faster()[pri:0, instance:scenarios.LoginDurationAppiumTest@64616ca2] 1684106402
=====

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-25
    • 1970-01-01
    • 2018-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-10
    相关资源
    最近更新 更多