New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

casper.back() not working (script appears to hang) #199

Closed
DarrenCook opened this Issue Jun 29, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@DarrenCook
Copy link
Contributor

DarrenCook commented Jun 29, 2014

When I call casper.back() the script appears to hang, but only with SlimerJS (0.9.1), not with PhantomJS.

Looking at the window it appears the browser has moved back. The code looks like:

casper.then(function(){
  this.back();
  this.waitForUrl(expectedUrl);
  this.wait(200,function(){
    this.capture("eg.png");
    });
 });

I have casper.options.stepTimeout = 6000, but it sits there for at least a number of minutes (I suspect forever), so I don't think the script is reaching waitForUrl(). (The screenshot is not taken.)

I've added some more debug lines, and if I console.log just after this.back() that is printed. But if I change the waitForUrl() to look like this:

this.waitForUrl(expectedUrl,function(){
    console.log("URL ("+expectedUrl+") was found");
    },function(){
    console.log("TIMEOUT ("+expectedUrl+")");
    },1000);    //Only give it one second

it does not do anything: neither callback gets called. I.e. casper appears to get as far as calling waitForUrl but then neither succeeds nor times out.

(I'm testing my web app's use of the HTML history API; the tests run to completion in PhantomJS.)
(Using casperjs 1.1.0-beta3)

@muffinresearch

This comment has been minimized.

Copy link

muffinresearch commented Feb 18, 2015

Fwiw. I've seen the same thing. I had to use a casper.open() as a workaround.

@laurentj laurentj added this to the SlimerJS 0.9.6 milestone Feb 19, 2015

@laurentj laurentj modified the milestones: SlimerJS 0.9.6, SlimerJS 0.9.7 Jun 8, 2015

@laurentj laurentj modified the milestones: SlimerJS 0.9.7, SlimerJS 0.10 Mar 11, 2016

@laurentj

This comment has been minimized.

Copy link
Owner

laurentj commented Apr 27, 2016

Unit tests of CasperJS show that casper.back() is working with SlimerJS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment