No click event generated using casper ver 1.1.0-beta3 on the Mac

50 views
Skip to first unread message

Scott Snyder

unread,
Apr 9, 2014, 3:10:44 PM4/9/14
to casp...@googlegroups.com
I am trying to catch a click event using capser.on('click') and do not ever see this event being generated even though I am explicitly clicking on a link.

For example if I run the following script:

casperjs test clicktest.js

the test is successful but the click does not get caught and no message is displayed.
Is this a known issue with the current version of casper or is there a problem with my syntax?

clicktest.js

casper.on('click', function(selector) {
    casper.echo('Click: I clicked ' + selector ); 
}); 

casper.test.begin('Click test', function(test) {
    casper.start('https://duckduckgo.com/?q=hello');

    var mySelector = '#r1-0 > div.links_main.links_deep > h2 > a'
    casper.waitForSelector((mySelector),
       function success() {
           test.assertExists((mySelector));
           this.click((mySelector));
       },
       function fail() {
           test.assertExists((mySelector));
    });

   casper.run(function() {test.done();});
});


-- Scott

Nicolas Perriault

unread,
Apr 9, 2014, 3:16:59 PM4/9/14
to casp...@googlegroups.com
From: Scott Snyder scott.h...@gmail.com
To: casp...@googlegroups.com casp...@googlegroups.com
Subject:  [casperjs] No click event generated using casper ver 1.1.0-beta3 on the Mac

> I am trying to catch a click event using capser.on('click') and do not ever
> see this event being generated even though I am explicitly clicking on a
> link.

It’s only available in master for now, and will be available in 1.1-beta4.

++ 

--
Nicolas Perriault

Scott Snyder

unread,
Apr 9, 2014, 3:56:09 PM4/9/14
to casp...@googlegroups.com
Ok, great.
It was unclear from the documentation that this event would become available in 1.1 and was not in the beta.
Any idea when beta 4 will be available or should I download the master?

-- Scott 
Reply all
Reply to author
Forward
0 new messages