I'm using CasperJS (with the slimerjs engine) to fill a form. This is however not working.
I tried it with a simple google.com script:
var casper = require("casper").create({
verbose: true,
logLevel: "debug"
});
var fs = require("fs");
phantom.cookiesEnabled = true;
casper.options.viewportSize = { width: 1024, height: 768 };
casper.start();
casper.userAgent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
casper.thenOpen("http://www.google.com", function(response) {
casper.fill("form[id='gbqf']", {
q: "test"
}, true);
}).run();
The form is not filled, nothing happens after the page is loaded.. The verbose log states:
[info] [remote] attempting to fetch form element from selector: 'form[id='gbqf']'
[info] [phantom] Done 2 steps in 1086ms
(and then ends)
What am I doing wrong? The form ID is 100% correct..