Following is the hlml of the login form that I have
casper.waitForSelector("form input[name='name']", function() {
this.fillSelectors('form#user-login', {
'input[name = name ]' : 'abc@gmail.com',
'input[name = pass ]' : 'pwd'
}, true);
});
Simply use this (see waitForSelector docs). Firstly, wait for the form to be loaded. Then fill the form using the selectors.