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) {
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