takeScreenshot fails with exception using wd (JavaScript, NodeJS)

Hello,
I get an exception when I try to capture a screenshot with wd. I use JavaScript and the wd package.
I wrote a demo that you could run here and see the failure:


I get the same error if I do saveScreenshot() instead of takeScreenshot().
The error looks like this:
Error: [takeScreenshot()] Error response status: 13, , UnknownError - An unknown
server-side error occurred while processing the command. Selenium error: unknown
error: cannot activate web view
(Session info: webview=33.0.0.0)
(Driver
info: chromedriver=2.18.343845
(73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1
x86_64)
at _stream_readable.js:908:16

Here’s an except from the code (but see link above for the whole thing):
return driver.takeScreenshot().then(function (image) {
return fs.writeFile(‘screenshot.png’, image, ‘base64’, function (err) {
console.log(‘Screenshot: screenshot.png’);
if (err) {
console.log(err);
}
}).then(null, function(err) {
console.log(‘do something!!!’);
});});

Hello… how come no one is answering?? Nobody does NodeJS + Appium and tries to take a screenshot?
Please help! :slight_smile:

To whoever runs into this issue, this only happens when using emulators, for example, using AVD manager to create an Android Nexus emulator, or a Sauce Labs emulator. Seems like the issue is with the emulators and not with the wd client