CasperJS mock click event

// First wait for detecting this element
this.waitForSelector('CSS selector', function(){
  this.echo('Find this element', 'INFO');
}
// And then try to mock click event
casperjs.evaluate(function(){
  $("CSS selector").click();
});
// OR
casperjs.click("CSS selector");
// OR
casperjs.evaluate(function() {
  document.querySelectorAll('CSS selector')[number].click();
});
// OR LABEL
casperjs.clickLabel("LABEL",'a');

你可能感兴趣的:(CasperJS mock click event)