getScreenshotAs as BASE64 produces string with new line characters
See original GitHub issueThe problem
String generated by getScreenshotAs
method is not valid base64
string
((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64)
Environment
- Appium version (or git revision) that exhibits the issue: 1.18.1
- Last Appium version that did not exhibit the issue (if applicable): don’t know (
- Desktop OS/version used to run Appium: iOS Catalina 10.15.6
- Node.js version (unless using Appium.app|exe): 12.18.1
- Npm or Yarn package manager: npm
- Mobile platform/version under test: iOS
- Real device or emulator/simulator: emulator
- Appium CLI or Appium.app|exe: Appium CLI
Details
Code To Reproduce Issue [ Good To Have ]
https://github.com/pashidlos/appium-issue-14684/blob/master/src/test/java/TestExample.java
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why does the base64 of a string contain "\n"? - Super User
Wrap encoded lines after COLS character (default 76 ). ... to co-operate, I am using tr to indiscriminately strip every newline on stdout....
Read more >getScreenshotAs as BASE64 produces string with new line characters
The problem. String generated by getScreenshotAs method is not valid base64 string ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64) ...
Read more >How to write a generic base64 screenshot method using ...
2 Answers 2 ; static String getScreenshot ; String screenshotBase64 ; = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64); return ...
Read more >Base64 Encoded String Contains a line break '\n' - Search
It appears that there is a limitation of 76 char for Base64 encoded sting and a line break is added after 76 characters....
Read more >5.0.5 - Attaching screenshot as Base64 String to Report - Part VII
Take a screenshot as png , jpg file - convert to base64 string and ... ... Extent Report Latest - 5.0.5 - Attaching...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Selenium Java client follows RFC4648 starting from
4.5.1
: https://github.com/SeleniumHQ/selenium/pull/11107 (I’m not sure about other clients). Is it something to be handled on Appium server side? Or Appium Java client side?Could you create an issue in the Java client? We maybe update server side to not have
\n
but potentially old Android/chrome (for example) needs the old one. WinAppDriver, for example, as well. So, at least Appium client may need to keep the old one still.[append] https://github.com/appium/WebDriverAgent/search?q=base64EncodedStringWithOptions it seems like… the method in appium/WDA was fastest in 10 times average in each options on my local. (0.01 or less tho). Hm…