Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
181 views
by Contributing Tester (92 points)

Negative value in setScriptTimeout() is not working.
Look at code below

var script = "
        var callback = arguments[arguments.length - 1];
        window.onbeforeunload = function(e){
          var confirmationMessage = "Close app?";
          (e || window.event).returnValue = confirmationMessage;
          return confirmationMessage;
          callback('CLOSED!');
        }
     "
 driver.executeAsyncScript(script).then(function(val){
       console.log(val);
     })

 

Here we should get CLOSED!

 

 

timeout === 0
ScriptTimeoutError: asynchronous script timeout: result was not received in 0 seconds.

timeout === -1
ScriptTimeoutError: asynchronous script timeout: result was not received in -1 seconds

 

If someone is encountering this issue, please provide solution.

by The go-to Tester (181 points)
Why do you need timeout to be -1. Practically timeout can not be -1. It should be always equal to or above 0.

Please log in or register to answer this question.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...