Advertisement
Guest User

Untitled

a guest
Jul 9th, 2014
120
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.     //casper.then(function(){
  16.     //  casper.wait(4000);
  17.     //})
  18.     casper.wait(4000);
  19. }
  20.  
  21. casper.then(function(){
  22.     runCode();
  23. });
  24.  
  25. casper.run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement