CasperJS click on buttons is not working

966 views Asked by At

CasperJS click on buttons is not working when jQuery is explicitly injected on the page. It works otherwise.

CasperJS code:

casper.waitForSelector("#somethingelse1").thenClick("#somethingelse1");
1

There are 1 answers

0
Twtheo On

If you are explicitly trying to click something using JQuery, the way I do it (still fairly new at casper and using JQuery) is as follows.

casper.waitForSelector('#somethingelse1', function(){ casper.evaluate(function(){ JQuery('#somethingelse1').click(); }); });