开发者

Using setTimeout in extension for Selenium IDE

开发者 https://www.devze.com 2023-03-26 17:30 出处:网络
I\'m trying to use JavaScript\'s setTimeout in an extension I\'ve made for Selenium IDE. In short I ha开发者_StackOverflowve made the extension to take a username and password to login to a page, rat

I'm trying to use JavaScript's setTimeout in an extension I've made for Selenium IDE.

In short I ha开发者_StackOverflowve made the extension to take a username and password to login to a page, rather than having to use a few commands on every test I make, it'd save a lot of time using my custom command.

So obviously In need to wait for the page to load, so I have added a setTimeout which calls a function that will keep checking if the page is ready yet.

setTimeout only seems to run the once however.

Thinking I may have something wrong with my script I just copied some off w3schools and that fails to work either, so tried this simple one below, which surely should work, but I only get a log output of '1'.

var i=0;

function loopThrough(){
    i=i+1;
    LOG.info(i);
    setTimeout("loopThrough()", 2500);  
}

loopThrough();
0

精彩评论

暂无评论...
验证码 换一张
取 消