Issue with CasperJS not locating the ID after setting it
Casper.then(function () {
screenLog();
var id = String("_newid_");
var arrow = this.evaluate(function () {
var arrows = document.querySelectorAll('span.select2-selection__arrow');
arrows[1].innerHTML = "aa";
arrows[1].id = id;
return arrows[1].innerHTML;
});
screenLog();
this.click("#"+id);
screenLog();
});
Error message received: CasperError: Cannot dispatch mousedown event on nonexistent selector: #newid