sudharsan-selvaraj / appium-dashboard-plugin

Appium plugin that provides complete test logs, video recording of test and device logs(logcat and syslogs) for easy debugging.
116 stars 28 forks source link

Exception when taking the screenshot while using the ThreadLocalDriver.setTLDriver as driver #51

Closed Sivasankaramalan closed 2 years ago

Sivasankaramalan commented 2 years ago

Logs: `org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The default behavior for this command was to proxy, but the driver did not have the 'proxyCommand' method defined. To fully support plugins, drivers should have 'proxyCommand' set to a jwpProxy object's 'command()' method, in addition to the normal 'proxyReqRes' Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'Dracarys.local', ip: '2401:4900:2180:a6dc:8c65:c09f:b3d7:28f9%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '13.0.1' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {appActivity: tokko.onlineshop.jual.mitra..., appPackage: tokko.onlineshop.jual.mitra..., automationName: UiAutomator2, clearDeviceLogsOnStart: true, databaseEnabled: false, desired: {appActivity: tokko.onlineshop.jual.mitra..., appPackage: tokko.onlineshop.jual.mitra..., automationName: UiAutomator2, clearDeviceLogsOnStart: true, mjpegServerPort: 62889, nativeWebScreenshot: true, noReset: false, platformName: android, platformVersion: 11, skipUnlock: true, udid: RF8N32LS6TK}, deviceApiLevel: 30, deviceManufacturer: samsung, deviceModel: SM-N770F, deviceName: RF8N32LS6TK, deviceScreenDensity: 420, deviceScreenSize: 1080x2400, deviceUDID: RF8N32LS6TK, javascriptEnabled: true, locationContextEnabled: false, mjpegServerPort: 62889, nativeWebScreenshot: true, networkConnectionEnabled: true, noReset: false, pixelRatio: 2.625, platform: LINUX, platformName: Android, platformVersion: 11, skipUnlock: true, statBarHeight: 85, takesScreenshot: true, udid: RF8N32LS6TK, viewportRect: {height: 2104, left: 0, top: 85, width: 1080}, warnings: {}, webStorageEnabled: false} Session ID: fdb02aed-3118-411a-8936-38e2b6ae6e73

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:247)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:41)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
at io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:45)
at io.appium.java_client.MobileElement.execute(MobileElement.java:1)
at io.appium.java_client.android.AndroidElement.execute(AndroidElement.java:1)
at org.openqa.selenium.remote.RemoteWebElement.getText(RemoteWebElement.java:166)`
Sivasankaramalan commented 2 years ago

Applium Log

[HTTP] --> GET /wd/hub/session/5a6c93f7-83c0-406b-abc7-6107829bae30/element/8e1eb9a2-eaf9-4b68-a8ea-9e781c0e1f32/text
[HTTP] {}
[debug] [W3C (5a6c93f7)] Would have proxied command directly, but a plugin exists which might require its value, so will let its value be collected internally and made part of plugin chain
[debug] [W3C (5a6c93f7)] Calling AppiumDriver.getText() with args: ["8e1eb9a2-eaf9-4b68-a8ea-9e781c0e1f32","5a6c93f7-83c0-406b-abc7-6107829bae30"]
[Appium] Plugins which can handle cmd 'getText': appium-dashboard
[Appium] Plugin appium-dashboard is now handling cmd 'getText'
[Appium] Executing default handling behavior for command 'getText'
[debug] [W3C (5a6c93f7)] Encountered internal error running command: Error: The default behavior for this command was to proxy, but the driver did not have the 'proxyCommand' method defined. To fully support plugins, drivers should have 'proxyCommand' set to a jwpProxy object's 'command()' method, in addition to the normal 'proxyReqRes'
[debug] [W3C (5a6c93f7)]     at Object.defaultBehavior [as next] (/usr/local/lib/node_modules/appium/lib/appium.js:523:17)
[debug] [W3C (5a6c93f7)]     at SessionManager.<anonymous> (/Users/sivasankaramalan.g/.appium/appium-dashboard/node_modules/appium-dashboard/lib/plugin/session-manager.js:131:41)
[debug] [W3C (5a6c93f7)]     at Generator.next (<anonymous>)
[debug] [W3C (5a6c93f7)]     at fulfilled (/Users/sivasankaramalan.g/.appium/appium-dashboard/node_modules/appium-dashboard/lib/plugin/session-manager.js:24:58)
[HTTP] <-- GET /wd/hub/session/5a6c93f7-83c0-406b-abc7-6107829bae30/element/8e1eb9a2-eaf9-4b68-a8ea-9e781c0e1f32/text 500 37 ms - 1023
sudharsan-selvaraj commented 2 years ago

This looks like an issue with the version of uiautomator2 server. Updating the uiautomator2 should resolve the issue.

Command to update the driver is appium driver update uiautomator2

Sivasankaramalan commented 2 years ago

Done!, thank you!