Edit : I tried with 'select[name="mainForm:projectSelectOneMenu"]' : "3" and it works...
Try using that :
//Emitted when a screenshot image has been captured.
casper.on('capture.saved', function(targetFile) {
this.echo('screen properly done at ' + targetFile);
});
this.fillSelectors('form#mainForm', {
'select[name*="mainForm"]' : "3"
}, false);
this.wait(2000,function(){
this.echo("i saw my new value");
this.capture('imgFormCasper.jpg', undefined, {
format: 'jpg',
quality: 75
});
});
or maybe that :
this.fillSelectors('form#mainForm', {
'select[name*="projectSelectOneMenu"]' : "3"
}, false);
this.wait(2000,function(){
this.echo("i saw my new value");
this.capture('imgFormCasper.jpg', undefined, {
format: 'jpg',
quality: 75
});
});
So try this instruction :
console.log("id = mainForm:projectSelectOneMenu ? -> "+this.getElementAttribute('select[name="mainForm:projectSelectOneMenu"]','id'));
You should have : And if you haven't an IDE, test your code here to be sure you haven't a syntax error : http://esprima.org/demo/validate.html