CasperJS click on buttons is not working

1k 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 best solutions below

0
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(); }); });