Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning empty screenshot on Android 4.4.2 #5202

Closed
jhuska opened this issue Jun 3, 2015 · 5 comments
Closed

Returning empty screenshot on Android 4.4.2 #5202

jhuska opened this issue Jun 3, 2015 · 5 comments
Labels
Android related to Android-native driver(s) Bug a problem that needs fixing

Comments

@jhuska
Copy link

jhuska commented Jun 3, 2015

I am taking screenshot by well known way:

File screenshot = device.getScreenshotAs(OutputType.FILE);
String deviceName = device.getCapabilities().getCapability("deviceName").toString();
File destFile = new File(BUILD_DIR + File.separator
            + deviceName + "-" + screenshotName + ".png");
try {
   FileUtils.copyFile(screenshot, destFile);
} catch (IOException ex) {
   throw new RuntimeException(ex);
}

It works just fine on my devices, expect Samsung Galaxy S4, which is running Android 4.4.2.

In Appium server log I can find these lines:

/wd/hub/session/5a1b71ee-5b92-468d-8c54-eb1356f837dc/screenshot
[debug] executing cmd: path/to/sdk/platform-tools/adb -s [particularSerialNumber] shell "/system/bin/rm /data/local/tmp/screenshot.png; /system/bin/screencap -p /data/local/tmp/screenshot.png "
[debug] executing cmd: path/to/sdk/platform-tools/adb -s [particularSerialNumber] pull /data/local/tmp/screenshot.png "/tmp/appium11553-11542-1iswk7x.png"
[debug] Responding to client with success: {"status":0,"value":"","sessionId":"5a1b71ee-5b92-468d-8c54-eb1356f837dc"}
<-- GET /wd/hub/session/5a1b71ee-5b92-468d-8c54-eb1356f837dc/screenshot {"status":0,"value":"","sessionId":"5a1b71ee-5b92-468d-8c54-eb1356f837dc"}�

Please see that value is empty. In result it creates an empty file.

When executing those adb commands manually, it works. I am running Appium from source, with pretty much fresh master (May 4) - all found issues related to screenshots were resolved sooner.

@triager triager added the Needs Triage bugs which are not yet confirmed label Jun 3, 2015
@sebv
Copy link
Member

sebv commented Jun 3, 2015

Try with the screenshotWaitTimeout cap.

@sebv sebv added OnGoing and removed Needs Triage bugs which are not yet confirmed labels Jun 3, 2015
@jhuska
Copy link
Author

jhuska commented Jun 3, 2015

Thanks @sebv, I tried it. Unfortunately it does not help.

Is not that cap. iOS only?

@sebv
Copy link
Member

sebv commented Jun 3, 2015

Ok put it in bug, I remember it is one of the thing we have in backlog, will tackle those after current Appium rewrite effort.

@sebv sebv added Bug a problem that needs fixing Android related to Android-native driver(s) and removed OnGoing labels Jun 3, 2015
@sebv sebv added this to the Bugs milestone Jun 3, 2015
@jlipps jlipps added Bug a problem that needs fixing and removed Bug a problem that needs fixing labels Nov 10, 2016
@jlipps jlipps removed this from the Bugs milestone Nov 10, 2016
@imurchie
Copy link
Contributor

This has all been changes. Closing.

@lock
Copy link

lock bot commented Apr 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android related to Android-native driver(s) Bug a problem that needs fixing
Projects
None yet
Development

No branches or pull requests

5 participants