Advertisement
Guest User

setTimeout() in casperjs

a guest
Jul 9th, 2014
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var casper = require('casper').create();
  2.  
  3. casper.start("http://www.google.com");
  4.  
  5. function runCode() {
  6.  
  7.     console.log("in runcode");
  8.  
  9.     casper.then(function(){
  10.         if (true){
  11.             console.log("about to invoke setTimeout function");
  12.             setTimeout(runCode, 1000);
  13.         }
  14.     });
  15. }
  16.  
  17. casper.then(function(){
  18.     runCode();
  19. });
  20.  
  21. casper.run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement