mirror of
https://github.com/appium/appium.git
synced 2026-01-25 03:38:52 -06:00
Merge pull request #1144 from bootstraponline/fix_screenshot
Fix screenshotStatus
This commit is contained in:
@@ -26,8 +26,9 @@ public class TakeScreenshot extends CommandHandler {
|
||||
*/
|
||||
@Override
|
||||
public AndroidCommandResult execute(final AndroidCommand command) {
|
||||
final boolean result = UiDevice.getInstance().takeScreenshot(
|
||||
new File("/data/local/tmp/screenshot.png"));
|
||||
final File screenshot = new File("/data/local/tmp/screenshot.png");
|
||||
screenshot.mkdirs();
|
||||
final boolean result = UiDevice.getInstance().takeScreenshot(screenshot);
|
||||
return getSuccessResult(result);
|
||||
}
|
||||
}
|
||||
@@ -747,9 +747,14 @@ Android.prototype.getScreenshot = function(cb) {
|
||||
}
|
||||
],
|
||||
// Top level cb
|
||||
function(){
|
||||
function(err, res) {
|
||||
var screenshotStatus = status.codes.Success.code;
|
||||
try {
|
||||
screenshotStatus = res[0].value === false ? status.codes.UnknownError.code : screenshotStatus;
|
||||
} catch(e) {
|
||||
}
|
||||
cb(null, {
|
||||
status: status.codes.Success.code
|
||||
status: screenshotStatus
|
||||
, value: b64data
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user