appium / appium/java-client

WebdriverException when doing driver.resetApp()

Open
#1,184 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

Description

In some of my runs I get WebdriverException exactly when trying to execute the command driver.resetApp() for some reason, logs available.

Environment

  • java client build version: 7.1.0
  • Real device saucelabs

Details

Please provide more details, if necessary.

Code To Reproduce Issue [ Good To Have ]

        capabilities.setCapability("noReset", true);

then in afterEach(){
driver.resetApp()
}

Ecxeption stacktraces

org.openqa.selenium.WebDriverException: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 Server Error</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /rest/appium/Samsung_Galaxy_A6_2018_real/79db28c7-d0ae-4d02-820f-bff2b8bf12a8/wd/hub/session/986ec859-b83f-4c27-9738-69d876fa3d7f/appium/app/reset. Reason:
<pre>    Server Error</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>
Command duration or timeout: 484 milliseconds
Build info: version: '4.0.0-alpha-1', revision: 'd1d3728cae', time: '2019-04-24T13:42:21'
System info: host: 'ubuntu-tpl', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-121-generic', java.version: '1.8.0_171'
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {adbPort: 15027, appActivity: com.tigerspike.emirates.pre..., appPackage: com.emirates.ek.android.sta..., automationName: UIAutomator2, chromedriverChromeMappingFile: /root/.testobject_devices/w..., chromedriverExecutableDir: /root/.testobject_devices/w..., chromedriverPorts: [[26270, 26280]], clearDeviceLogsOnStart: true, databaseEnabled: false, desired: {adbPort: 15027, appActivity: com.tigerspike.emirates.pre..., appPackage: com.emirates.ek.android.sta..., automationName: UIAutomator2, chromedriverChromeMappingFile: /root/.testobject_devices/w..., chromedriverExecutableDir: /root/.testobject_devices/w..., chromedriverPorts: [[26270, 26280]], clearDeviceLogsOnStart: true, deviceName: Samsung_Galaxy_A6_2018_real, newCommandTimeout: 180, noReset: true, optionalIntentArguments: --es baseUrl https://289004..., platformName: Android, resetKeyboard: true, suppressKillServer: true, systemPort: 8227, testobject_api_key: 9E962E9E19BC47B9B0256654121..., testobject_app_id: 1938, testobject_device: ^(?=.*Samsung)(?!.*Tab).*, testobject_phone_only: true, testobject_platform_name: ANDROID, unicodeKeyboard: true}, deviceApiLevel: 26, deviceContextId: 9f52cd45-0236-47e7-804b-d96..., deviceManufacturer: samsung, deviceModel: SM-A600FN, deviceName: 127.0.0.1:16016, deviceScreenDensity: 320, deviceScreenSize: 720x1480, deviceUDID: 127.0.0.1:16016, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 180, noReset: true, optionalIntentArguments: --es baseUrl https://289004..., pixelRatio: 2, platform: LINUX, platformName: ANDROID, platformVersion: 8.0.0, resetKeyboard: true, statBarHeight: 48, suppressKillServer: true, systemPort: 8227, takesScreenshot: true, testobject_api_key: 9E962E9E19BC47B9B0256654121..., testobject_app_id: 1938, testobject_device: Samsung_Galaxy_A6_2018_real, testobject_device_name: Samsung Galaxy A6 2018, testobject_device_session_id: 1af86c88-26ed-479b-bee5-cf1..., testobject_phone_only: true, testobject_platform_name: ANDROID, testobject_project_id: android-pr, testobject_test_live_view_url: https://app.testobject.com/..., testobject_test_report_api_url: https://app.testobject.com/..., testobject_test_report_id: 6056, testobject_test_report_url: https://app.testobject.com/..., testobject_user_id: emirates, unicodeKeyboard: true, viewportRect: {height: 1336, left: 0, top: 48, width: 720}, warnings: {}, webStorageEnabled: false}
Session ID: 986ec859-b83f-4c27-9738-69d876fa3d7f
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
	at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:611)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:634)
	at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:45)
	at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
	at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
	at io.appium.java_client.InteractsWithApps.resetApp(InteractsWithApps.java:93)
	at com.emirates.android.specs.BaseSpec.afterEach(BaseSpec.java:142) (driver.resetApp())
	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.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:532)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeMethodInExtensionContext(ClassTestDescriptor.java:436)
	at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$synthesizeAfterEachMethodAdapter$15(ClassTestDescriptor.java:428)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAfterEachMethods$9(TestMethodTestDescriptor.java:212)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeAllAfterMethodsOrCallbacks$13(TestMethodTestDescriptor.java:230)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAllAfterMethodsOrCallbacks(TestMethodTestDescriptor.java:228)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeAfterEachMethods(TestMethodTestDescriptor.java:211)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:118)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:59)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:108)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:120)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at io.appium.java_client.InteractsWithApps.resetApp, identified in the stack trace, and reproduce the call with noReset enabled on the reported Android device setup. Compare the resetApp request and response when it succeeds versus the HTTP 500 failure; done means the intermittent failure is explained and a verified fix or precise reproduction is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.