nightwatch: sessionId is NULL in beforeEach hook

Has anything changed around sessionId? It’s coming up as null now.

....
afterEach: function(callback) {
  var sessionId = this.client.sessionId; //null
}
....

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 27 (12 by maintainers)

Most upvoted comments

Hmm, I’ll check about beforeEach. You can also call .end() in afterEach, like:

var sessionId = browser.sessionId; browser.end(function() { // update saucelabs with sessionId done(); });

On Tuesday, May 5, 2015, Naren Bhattarai notifications@github.com wrote:

Thanks.

However even sessionId in beforeEach is null. I’m using nightwatch v0.6.7

Here is my globalsModule.

module.exports = { beforeEach : function(browser, cb) { console.log(browser.sessionId); cb(); }, afterEach : function(browser, cb) { console.log(browser.sessionId); cb(); } };

— Reply to this email directly or view it on GitHub https://github.com/beatfactor/nightwatch/issues/435#issuecomment-99104467 .