Reputation: 143
I can't figure out how to click this button with CasperJS.
So far, I've been using thenClick
and searching for the link with a[href='']
but I can't do that for this button. It shows this when I inspect the element of the button:
<a style="float"href="javascript:void(0)"onclick="$('#divNewSection').slideToggle()">add...</a>
Upvotes: 0
Views: 1016
Reputation: 61892
There are many ways to click that link. You have to find a unique way to address it.
For example:
casper.click("a[style='float']")
casper.click("a[style='float'][onclick*='.slideToggle()']")
casper.click('a[onclick="$(\'#divNewSection\').slideToggle()"]')
casper.click(x("//a[text()='add...']"))
where var x = require('casper').selectXPath;
Upvotes: 1