Webdriverio: "Cannot read property 'log' of undefined" for crashes

Created on 18 Mar 2016  ·  4Comments  ·  Source: webdriverio/webdriverio

In some errors I often get "Cannot read property 'log' of undefined"

https://github.com/graingert/wdio-console-log-crash/tree/master

Bug🐛

Most helpful comment

Already working on fixing this :wink:

All 4 comments

I'm getting this also in a lot of the errors. Coming from line 287 of webdriverio.js:
this.logger.log('\tSaved screenshot: ' + fileName);

Already working on fixing this :wink:

Can you please explain how to fix this manually in the meantime? It causes too many crashes in my tests..

@eyalzek I monkey-fixed this locally by putting an if (this.logger) around the this.logger.log call. There might be a better way. 🐵
https://github.com/webdriverio/webdriverio/blob/master/lib/webdriverio.js#L220

Was this page helpful?
0 / 5 - 0 ratings

Related issues

imranazad picture imranazad  ·  3Comments

dahumadasg picture dahumadasg  ·  3Comments

briancullinan picture briancullinan  ·  4Comments

davidsoderberg picture davidsoderberg  ·  4Comments

sarahdayan picture sarahdayan  ·  4Comments