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

device-farm integration #1

Closed saikrishna321 closed 2 years ago

saikrishna321 commented 3 years ago

@sudharsan-selvaraj Thanks for the great plugin. @SrinivasanTarget and I have actively maintaining appium-device-farm to solve parallel execution and one of the part of the plugin was dashboard to show enough information about the device state and tests executed on the device with all possible information. We see that this plugin has all that we wanted to build.

I gave it a try with device-farm and bumped into this issue

UnknownError: An unknown server-side error occurred while processing the command. Original error: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object
      at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/errors.js:804:9)
      at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:370:37)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

Also wanted to know if you would be happy to have this integrated with device-farm so we don't re-invent the wheel for few changes.

Thoughts?

sudharsan-selvaraj commented 3 years ago

Hi @saikrishna321, I just created this plugin as a POC to understand how the appium plugin ecosystem works. I am more than happy to integrate these changes with the device-farm plugin and there are a lot more additional features I have in my mind which we can also eventually add up to the device-farm plugin.

PramodKumarYadav commented 3 years ago

Maybe I can add/confirm that the issue is not just with device farm (or related to 2.0).

Without loading the dashboard plugin, I could successfully run the tests using appium 2.0 (using appium --base-path /wd/hub . See below. image However when I try to run the same test by also loading the plugin appium --base-path /wd/hub --plugins=appium-dashboard , I get the exact same failure as reported by saikrishna. i.e. org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object

image

If it helps with debugging, it consistently failed with the cursor on the first field of log in.

sudharsan-selvaraj commented 3 years ago

This issue might be caused while saving the screenshot. Sometimes, getScreenShot method return the below error which is not handled properly in the plugin.

{"error":"unable to capture screen","message":"Failed to capture a screenshot. Does the current view have 'secure' flag set?"}

I have provided a fix and will see if this issue is resolved.

PramodKumarYadav commented 3 years ago

I still get this issue, hence reopening. I am not taking screenshots so maybe the root cause is somewhere else? org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'DESKTOP-GPU5LFR', ip: '172.18.144.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {app: D:\happium\app\Android.Sauc..., appPackage: com.swaglabsmobileapp, appWaitActivity: com.swaglabsmobileapp.MainA..., automationName: UiAutomator2, avd: Pixel_4_API_31, avdArgs: -netfast, avdLaunchTimeout: 300000, avdReadyTimeout: 300000, clearDeviceLogsOnStart: true, databaseEnabled: false, desired: {app: D:\happium\app\Android.Sauc..., appWaitActivity: com.swaglabsmobileapp.MainA..., automationName: UiAutomator2, avd: Pixel_4_API_31, avdArgs: -netfast, avdLaunchTimeout: 300000, avdReadyTimeout: 300000, clearDeviceLogsOnStart: true, deviceName: emulator-5554, platformName: android, systemPort : 8200, udid: emulator-5554}, deviceApiLevel: 31, deviceManufacturer: Google, deviceModel: sdk_gphone64_x86_64, deviceName: emulator-5554, deviceScreenDensity: 440, deviceScreenSize: 1080x2280, deviceUDID: emulator-5554, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.75, platform: LINUX, platformName: Android, platformVersion: 12, statBarHeight: 83, systemPort : 8200, takesScreenshot: true, udid: emulator-5554, viewportRect: {height: 2065, left: 0, top: 83, width: 1080}, warnings: {}, webStorageEnabled: false} Session ID: 7c0d3632-ce05-4d7f-96b5-5d3fafaa6bc6

sudharsan-selvaraj commented 3 years ago

@PramodKumarYadav, I haven't released the fix yet. I will release a new version tomorrow and will update the issue with the fixed version.

PramodKumarYadav commented 3 years ago

oh, that explains! Could I suggest in that case to leave the tickets open until after the fix is released and tested/okay?

sudharsan-selvaraj commented 2 years ago

Released as part of 1.0.0-beta.9