I have a web page where I have implemented a window.setTimeout
in javascript. The thing is I am implementing a timer which pops up a message when that time has expired. This value is stored in the cookie.
So, when the page loads up, I configure the timer with the timeout value. So, even if the page is reloaded, the timer is created again on every page load.
Now, when I trying to test this through htmlunit(version - 2.15), each page of my is starting to load longer than the usual.
We have following configurations for the Webclient
webClient.getOptions().setTimeout(FIVE_MINUTES_IN_MILLIS);
webClient.waitForBackgroundJavaScript(NINETY_SECONDS);
I am guessing the way window.setTimeout
is implemented in htmlunit is that it will wait for the timer to execute or waitForBackgroundJavaScript Timeout value(whichever occurs first). Hence, my htmlunit run is getting slowed as my timer is high(30 minutes) and each step of my htmlunit is waiting for 90 seconds.
How should I configure my htmlunit so that my script doesn't wait for that timer. Also, I need to have that waitForBackgroundJavaScript
, otherwise, my ajax calls won't work.
Can somebody help here?