I want to fill input #searchForm with CasperJS
I tried 3 methods and only one works (the sendKeys method !)
var casper = require("casper").create({
clientScripts: ["vendor/jquery.min.js"],
verbose: false,
logLevel: 'debug',
});
casper.waitForSelector('#search_field', function() {
console.log('#search_field FOUND !!!');
//document.querySelector('#search_field').value = 'search1'; //does not work
//casper.sendKeys('#search_field', 'search1'); // works !
//$('#search_field').val('search1'); // does not work
});
My preference would be to use jQuery to fill forms. Why don't the 2 other methods work?