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

0 like 0 dislike
156 views
by Contributing Tester (92 points)
closed by

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.

closed with the note: Duplicate post


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!

1.4k questions

1.6k answers

866 comments

1.9k users

...