Trying to click the below element via casperjs, but it's not working for me.
<img alt="Pay Button" class="v-button" role="button" src="https://test/wallet-services-web/xo/button.png" tabindex="0" style="cursor: pointer; transition-property: filter; transition-duration: 0.25s; filter: brightness(1);">
I am searching for this element through a bunch of nested iframes, and I can find it correctly -- but I can't seem to click on it correctly.
if (casper.exists('img.v-button')) {
console.log("Found button"); // the exists works - this is logged
casper.click('img.v-button'); // Approach 1: nothing happens
// Approach 2: nothing happens
// var x = require('casper').selectXPath;
// casper.click(x('(//img[@class="v-button"])'));
return true;
} else {
var result = traverseTreeDown();
if (result) {
return true;
} else {
casper.page.switchToParentFrame();
}
}
Both approach 1 and 2 doesn't work to click - even though I do get inside the "exists" block correctly.