Skip to content

Instantly share code, notes, and snippets.

@akhillb
Created January 30, 2016 11:13
Show Gist options
  • Save akhillb/877a055732c4cbefd500 to your computer and use it in GitHub Desktop.
Save akhillb/877a055732c4cbefd500 to your computer and use it in GitHub Desktop.
Getting the sessionId of a session running in nightwatch
module.exports = {
"Demo test Google" : function (browser) {
browser.session(function(session) {
console.log(session.sessionId);
});
browser
.url("http://www.google.com")
.waitForElementVisible('body', 1000)
.setValue('input[type=text]', 'nightwatch')
.waitForElementVisible('button[name=btnG]', 1000)
.click('button[name=btnG]')
.pause(1000)
.assert.containsText('#main', 'The Night Watch')
.end();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment