question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: appium server is showing 500 error when calling to get_screenshot_as_base64 while running Windows app test

See original GitHub issue

Windows Application Driver is 1.2.1.0

Current Behavior

While running windows app appium test, once I am calling to driver.get_screenshot_as_base64() I am getting the following error in appium server log:

[debug] [WindowsDriver@b02c (94a11461)] Calling AppiumDriver.getScreenshot() with args: ["94a11461-2ced-4895-b689-7cd4e44c6446"]
[debug] [WindowsDriver@b02c (94a11461)] Matched '/screenshot' to command name 'getScreenshot'
[debug] [WindowsDriver@b02c (94a11461)] Proxying [GET /screenshot] to [GET http://127.0.0.1:4724/wd/hub/session/B70CACF5-8A7E-4E2C-91BD-55B62AD131F1/screenshot] with no body
[debug] [WindowsDriver@b02c (94a11461)] ΰ΄€ΰ¨€ΰ΄€ΰ¨€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€ΰ΄€ΰ¨€δœ€δ”€ε€β€€βΌ€ηœ€ζ€βΌ€ζ €η”€ζˆ€βΌ€ηŒ€ζ”€ηŒ€ηŒ€ζ€€ζΌ€ζΈ€βΌ€δˆ€γœ€γ€€δŒ€δ„€δŒ€δ˜€γ”€β΄€γ €δ„€γœ€δ”€β΄€γ€δ”€γˆ€δŒ€β΄€γ€€γ„€δˆ€δ€β΄€γ”€γ”€δˆ€γ˜€γˆ€δ„€δ€γ„€γŒ€γ„€δ˜€γ„€βΌ€ηŒ€ζŒ€ηˆ€ζ”€ζ”€ζΈ€ηŒ€ζ €ζΌ€η€β€€δ €ε€ε€ε€€βΌ€γ„€βΈ€γ„€ΰ΄€ΰ΄€ΰ¨€δ„€ζŒ€ζŒ€ζ”€η€€η€γ¨€β€€ζ„€η€€η€€ζ°€ζ€€ζŒ€ζ„€η€ζ€€ζΌ€ζΈ€βΌ€ζ¨€ηŒ€ζΌ€ζΈ€β°€β€€β¨€βΌ€β¨€ΰ΄€ΰ΄€ΰ¨€δ„€ζŒ€ζŒ€ζ”€η€€η€β΄€δ”€ζΈ€ζŒ€ζΌ€ζ€ζ€€ζΈ€ζœ€γ¨€β€€ζœ€η¨€ζ€€η€€β°€β€€ζŒ€ζΌ€ζ΄€η€€ηˆ€ζ”€ηŒ€ηŒ€β°€β€€ζ€ζ”€ζ˜€ζ°€ζ„€η€ζ”€β°€β€€ζˆ€ηˆ€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€ζΈ€ζ”€ζŒ€η€ζ€€ζΌ€ζΈ€γ¨€β€€ζ¬€ζ”€ζ”€η€€β΄€ζ„€ζ°€ζ€€η˜€ζ”€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€η€ζ”€ζΈ€η€β΄€ε€η€€η€€ζ”€γ¨€β€€ζ„€η€€η€€ζ°€ζ€€ζŒ€ζ„€η€ζ€€ζΌ€ζΈ€βΌ€ζ¨€ηŒ€ζΌ€ζΈ€γ¬€β€€ζŒ€ζ €ζ„€ηˆ€ηŒ€ζ”€η€γ΄€η”€η€ζ˜€β΄€γ €ΰ΄€ΰ΄€ΰ¨€δ €ζΌ€ηŒ€η€γ¨€β€€γ„€γˆ€γœ€βΈ€γ€€βΈ€γ€€βΈ€γ„€γ¨€γ€γœ€γˆ€γ€ΰ΄€ΰ΄€ΰ¨€ε”€ηŒ€ζ”€ηˆ€β΄€δ„€ζœ€ζ”€ 渀琀㨀 愀瀀瀀怀甀洀ഀഀ਀ഀഀ਀ഀ਀
[debug] [WindowsDriver@b02c (94a11461)] δ €ε€ε€ε€€βΌ€γ„€βΈ€γ„€β€€γ”€γ€€γ€€β€€δ€€ζΈ€η€ζ”€ηˆ€ζΈ€ζ„€ζ°€β€€δ”€ηˆ€ηˆ€ζΌ€ηˆ€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€η€ζ”€ζΈ€η€β΄€δ°€ζ”€ζΈ€ζœ€η€ζ €γ¨€β€€γ„€γŒ€γŒ€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€η€ζ”€ζΈ€η€β΄€ε€η€€η€€ζ”€γ¨€β€€ζ„€η€€η€€ζ°€ζ€€ζŒ€ζ„€η€ζ€€ζΌ€ζΈ€βΌ€ζ¨€ηŒ€ζΌ€ζΈ€ΰ΄€ΰ΄€ΰ¨€ΰ΄€ΰ΄€ΰ¨€η¬€βˆ€ηŒ€η€ζ„€η€η”€ηŒ€βˆ€γ¨€γ„€γŒ€β°€βˆ€η˜€ζ„€ζ°€η”€ζ”€βˆ€γ¨€η¬€βˆ€ζ”€ηˆ€ηˆ€ζΌ€ηˆ€βˆ€γ¨€βˆ€η”€ζΈ€ζ¬€ζΈ€ζΌ€ηœ€ζΈ€β€€ζ”€ηˆ€ηˆ€ζΌ€ηˆ€βˆ€β°€βˆ€ζ΄€ζ”€ηŒ€ηŒ€ζ„€ζœ€ζ”€βˆ€γ¨€βˆ€δ„€ζΈ€β€€η”€ζΈ€ζ¬€ζΈ€ζΌ€ηœ€ζΈ€β€€ζ”€ηˆ€ηˆ€ζΌ€ηˆ€β€€ζΌ€ζŒ€ζŒ€η”€ηˆ€ηˆ€ζ”€ζ€β€€ζ€€ζΈ€β€€η€ζ €ζ”€β€€ηˆ€ζ”€ζ΄€ζΌ€η€ζ”€β€€ζ”€ζΈ€ζ€β€€ηœ€ζ €ζ€€ζ°€ζ”€β€€η€€ηˆ€ζΌ€ζŒ€ζ”€ηŒ€ηŒ€ζ€€ζΈ€ζœ€β€€η€ζ €ζ”€β€€ζŒ€ζΌ€ζ΄€ζ΄€ζ„€ζΈ€ζ€βΈ€βˆ€η΄€η΄€ΰ΄€ΰ¨€
[WindowsDriver@b02c (94a11461)] Got response with status 500: {"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}
[debug] [W3C] Matched W3C error code 'unknown error' to UnknownError
[debug] [WindowsDriver@b02c (94a11461)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: An unknown error occurred in the remote end while processing the command.
[debug] [WindowsDriver@b02c (94a11461)]     at errorFromW3CJsonCode (C:\Users\qahw\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\errors.js:1040:25)
[debug] [WindowsDriver@b02c (94a11461)]     at ProxyRequestError.getActualError (C:\Users\qahw\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\errors.js:909:14)
[debug] [WindowsDriver@b02c (94a11461)]     at WADProxy.command (C:\Users\qahw\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\jsonwp-proxy\proxy.js:352:19)
[debug] [WindowsDriver@b02c (94a11461)]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[debug] [WindowsDriver@b02c (94a11461)]     at WinAppDriver.sendCommand (C:\Users\qahw\.appium\node_modules\appium-windows-driver\lib\winappdriver.js:223:12)
[debug] [WindowsDriver@b02c (94a11461)]     at WindowsDriver.getScreenshot (C:\Users\qahw\.appium\node_modules\appium-windows-driver\lib\commands\general.js:48:22)
[HTTP] <-- GET /session/94a11461-2ced-4895-b689-7cd4e44c6446/screenshot 500 27 ms - 1221
[HTTP]

Pay attention to these chars:

ΰ¨€ΰ΄€ΰ¨€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€γ΄€ΰ΄€ΰ¨€δœ€δ”€ε€β€€βΌ€ηœ€ζ€βΌ€ζ €η”€ζˆ€βΌ€ηŒ€ζ”€ηŒ€ηŒ€ζ€€ζΌ€ζΈ€βΌ€δˆ€γœ€γ€€δŒ€δ„€δŒ€δ˜€γ”€β΄€γ €δ„€γœ€δ”€β΄€γ€δ”€γˆ€δŒ€β΄€γ€€γ„€δˆ€δ€β΄€γ”€γ”€δˆ€γ˜€γˆ€δ„€δ€γ„€γŒ€γ„€δ˜€γ„€βΌ€ηŒ€ζŒ€ηˆ€ζ”€ζ”€ζΈ€ηŒ€ζ €ζΌ€η€β€€δ €ε€ε€ε€€βΌ€γ„€βΈ€γ„€ΰ΄€ΰ΄€ΰ¨€δ„€ζŒ€ζŒ€ζ”€η€€η€γ¨€β€€ζ„€η€€η€€ζ°€ζ€€ζŒ€ζ„€η€ζ€€ζΌ€ζΈ€βΌ€ζ¨€ηŒ€ζΌ€ζΈ€β°€β€€β¨€βΌ€β¨€ΰ΄€ΰ΄€ΰ¨€δ„€ζŒ€ζŒ€ζ”€η€€η€β΄€δ”€ζΈ€ζŒ€ζΌ€ζ€ζ€€ζΈ€ζœ€γ¨€β€€ζœ€η¨€ζ€€η€€β°€β€€ζŒ€ζΌ€ζ΄€η€€ηˆ€ζ”€ηŒ€ηŒ€β°€β€€ζ€ζ”€ζ˜€ζ°€ζ„€η€ζ”€β°€β€€ζˆ€ηˆ€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€ζΈ€ζ”€ζŒ€η€ζ€€ζΌ€ζΈ€γ¨€β€€ζ¬€ζ”€ζ”€η€€β΄€ζ„€ζ°€ζ€€η˜€ζ”€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€η€ζ”€ζΈ€η€β΄€ε€η€€η€€ζ”€γ¨€β€€ζ„€η€€η€€ζ°€ζ€€ζŒ€ζ„€η€ζ€€ζΌ€ζΈ€βΌ€ζ¨€ηŒ€ζΌ€ζΈ€γ¬€β€€ζŒ€ζ €ζ„€ηˆ€ηŒ€ζ”€η€γ΄€η”€η€ζ˜€β΄€γ €ΰ΄€ΰ΄€ΰ¨€δ €ζΌ€ηŒ€η€γ¨€β€€γ„€γˆ€γœ€βΈ€γ€€βΈ€γ€€βΈ€γ„€γ¨€γ€γœ€γˆ€γ€ΰ΄€ΰ΄€ΰ¨€ε”€ηŒ€ζ”€ηˆ€β΄€δ„€ζœ€ζ”€ 渀琀㨀 愀瀀瀀怀甀洀ഀഀ਀ഀഀ਀ഀ਀
[debug] [WindowsDriver@b02c (94a11461)] δ €ε€ε€ε€€βΌ€γ„€βΈ€γ„€β€€γ”€γ€€γ€€β€€δ€€ζΈ€η€ζ”€ηˆ€ζΈ€ζ„€ζ°€β€€δ”€ηˆ€ηˆ€ζΌ€ηˆ€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€η€ζ”€ζΈ€η€β΄€δ°€ζ”€ζΈ€ζœ€η€ζ €γ¨€β€€γ„€γŒ€γŒ€ΰ΄€ΰ΄€ΰ¨€δŒ€ζΌ€ζΈ€η€ζ”€ζΈ€η€β΄€ε€η€€η€€ζ”€γ¨€β€€ζ„€η€€η€€ζ°€ζ€€ζŒ€ζ„€η€ζ€€ζΌ€ζΈ€βΌ€ζ¨€ηŒ€ζΌ€ζΈ€ΰ΄€ΰ΄€ΰ¨€ΰ΄€ΰ΄€ΰ¨€η¬€βˆ€ηŒ€η€ζ„€η€η”€ηŒ€βˆ€γ¨€γ„€γŒ€β°€βˆ€η˜€ζ„€ζ°€η”€ζ”€βˆ€γ¨€η¬€βˆ€ζ”€ηˆ€ηˆ€ζΌ€ηˆ€βˆ€γ¨€βˆ€η”€ζΈ€ζ¬€ζΈ€ζΌ€ηœ€ζΈ€β€€ζ”€ηˆ€ηˆ€ζΌ€ηˆ€βˆ€β°€βˆ€ζ΄€ζ”€ηŒ€ηŒ€ζ„€ζœ€ζ”€βˆ€γ¨€βˆ€δ„€ζΈ€β€€η”€ζΈ€ζ¬€ζΈ€ζΌ€ηœ€ζΈ€β€€

Expected Behavior

Screen short from windows application should be captured successfully

Minimal Reproducible Example

driver.get_screenshot_as_base64()

Environment

  • Operating system: Windows 10 OS, 64 bit
  • Appium server version (output of appium --version): appium 2.0.0 RC3
  • Appium driver(s) and their version(s): uiautomator2@2.10.2 (automationName β€˜UiAutomator2’)
  • Appium plugin(s) and their version(s): uiautomator2@2.10.2 (automationName β€˜UiAutomator2’)
  • Node.js version (output of node --version): v18.12.0
  • npm version (output of npm --version): 8.19.2
  • Last component(s) version which did not exhibit the problem: never worked
  • Platform and version under test: Windows
  • Real device or emulator/simulator: real windows app

Link to Appium Logs

https://github.com/bwomsm1/AppiumLogs/blob/master/win_app_appium.log

Futher Information

No response

Issue Analytics

  • State:open
  • Created 3 months ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
bwomsm1commented, Jun 23, 2023

Any good reason that you want the image with base64?

I am attaching the base64 data to html page, it has to be in base64.

0reactions
bwomsm1commented, Jul 25, 2023

Can you try taking normal screenshot without base64?

@anunay1 what API you are suggesting? I see that also get_screenshot_as_png() is passing through get_screenshot_as_base64() which I am using today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server-side error: 500 occurred while processing ...
Appium server shows 500 while prossing server. I built firsttime a testapp with android-sdk on my physical mobilephone via usb.
Read more >
Status err code 500 - Support
Device isn't picked up for execution and and at-last it shows as err message like above.
Read more >
Issue Selenium hub with appium ,server response code : 500
Hi All , Getting the below error when i am running selenium based grid in appium , ERROR log4j:WARN No appenders could be...
Read more >
Appium server Error - Issues/Bugs
i am using Windows 10 Operating system.While starting Appium Server Frequently getting 500 status codes error.Socket Hang up.Installed Appium Desktop ClientΒ ...
Read more >
Got 500 errors when use real iphone - Support
Sometimes i got the following 500 error: Original error: Cannot get 'xml' source of the current application and. Got response with statusΒ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found