executeAsync returns message: asynchronous script timeout

836 views
Skip to first unread message

rhazes

unread,
May 19, 2016, 11:42:19 AM5/19/16
to NightwatchJs
Hello, 

I am wondering if there is any insight into the error message I receive back from the executeAsync function.

My code is below:

exports.command = function(selector, time,  cb) {
 
var data = [{selector: selector, time: time}];


 
function listenForCanvasRender(data, done) {
   
var canvasElement = document.querySelector(data.selector);


    canvasElement
.addEventListener('sdk.render', _.debounce(function(event) {
       
done(true);
   
}, data.time));
 
}


 
function handleResult(result) {
   
var ret = result.value;
   
if (cb) {
      cb
(ret);
   
}
 
}

 
this.executeAsync(listenForCanvasRender, data, handleResult)
};


The result value that is passed back is this:

'asynchronous script timeout: result was not received in 0 seconds\n  (Session info: chrome=50.0.2661.102)\n  (Driver info: chromedriver=2.9.248307,platform=Mac OS X 10.10.3 x86_64) (WARNING: The server did not provide any stacktrace information)\nCommand duration or timeout: 242 milliseconds\nBuild info: version: \'2.46.0\', revision: \'87c69e2\', time: \'2015-06-04 16:16:47\'

Any help is appreciated.

Many Thanks,
Rachel

Andrei Rusu

unread,
May 20, 2016, 4:43:41 AM5/20/16
to nightw...@googlegroups.com
You can try increasing the timeout with this command:
http://nightwatchjs.org/api#timeoutsAsyncScript. I see you are using a
pretty old selenium server version, you should consider upgrading it -
latest is 2.53 at this point. If you are only using Chrome then you
could use it directly as detailed here:
https://github.com/nightwatchjs/nightwatch/issues/948 (docs will be
updated soon).
> --
> 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/bb33b2d1-573d-413b-a743-99583a6e19c7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

rhazes

unread,
May 23, 2016, 1:00:04 PM5/23/16
to NightwatchJs
Those are some nice tips. Thanks!

For the timeoutAsyncScript, do you recommend that I set that at the beginning of a session, perhaps globally in the beforeEach?
I'm definitely going to look into using WebDriver directly. 
Reply all
Reply to author
Forward
0 new messages