browser.end errors with Browserstack integration in after hooks

819 views
Skip to first unread message

Nico H

unread,
Aug 30, 2018, 9:36:11 PM8/30/18
to NightwatchJs
I just moved to Browserstack from using our own selenium and we are experiencing client.end errors in after and afterEach hooks. It happens in both Firefox and Chrome.
The error is as below

done() callback timeout of 10000ms was reached while executing "after". Make sure to call the done() callback when the operation finishes
 

   { value: { message: 'Session not started or terminated', error: [] },
     sessionId: '',
     status: 13 }
 Error while running .sessionAction() protocol action: Session not started or terminated

calling client.end in a test doesn't cause such error.

This is the sample test that errors:

module.exports = {
Bing: function(browser) {
browser
.waitForElementVisible('body', 1000)
.assert.title('Bing');
},
after: function(browser, done) {
browser.end(() => {
done();
});
}
};


This one works
module.exports = {
Bing: function(browser) {
browser
.waitForElementVisible('body', 1000)
.assert.title('Bing')
.end();
}
};

I've tried calling browser.session('delete', client.sessionId, done) but still the same error. And I confirmed sessionId is defined. 
I tried different combinations and noticed that in Browserstack logs, the session ends no matter is I call browser.end or not.

Config content:
{
"src_folders": [
"tests"
],
"selenium": {
"start_process": false,
"port": 80
},
"test_settings": {
"default": {
"selenium_host": "hub-cloud.browserstack.com",
"selenium_port": 80,
"desiredCapabilities": {
"resolution": "1280x1024",
"browserstack.user": "...",
"browserstack.key": "...",
"browserstack.local": true
},
"globals": {...}
},
"osx_hs_chrome": {
"desiredCapabilities": {
"os": "OS X",
"os_version": "High Sierra",
"browser": "Chrome",
"browser_version": "65.0",
"chromeOptions": {
"args": [
"auto-open-devtools-for-tabs"
]
}
}
},
"osx_hs_firefox": {
"desiredCapabilities": {
"os": "OS X",
"os_version": "High Sierra",
"browser": "Firefox",
"browser_version": "61.0"
}
}
}
}

Has anyone encountered this issue?

Nico H

unread,
Sep 4, 2018, 6:39:58 PM9/4/18
to NightwatchJs
I identified that the issue only happens in Nightwatch v1. BrowserStack's Nightwatch demo uses nightwatch v0.8 and it runs fine. I have reached out to BrowserStack support about this problem.

Greg Duckworth

unread,
Dec 17, 2018, 5:35:11 AM12/17/18
to NightwatchJs
Also with this Nico H, I am experiencing the same issue. 

However 1.0.14 of Nightwatch works fine, just 1.0.16 does not. I have raised https://github.com/nightwatchjs/nightwatch/issues/1943 as well.

Andrei Rusu

unread,
Dec 17, 2018, 12:30:38 PM12/17/18
to nightw...@googlegroups.com
Can you open an issue on Github please? 

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/5b8df5e7-00ae-439d-892d-ecbd68bcf375%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages