Hello,
I am trying to pass arguments in custom commands, but I am wondering if it's possible. I just want to generate a basic "alert" in javascript.
In my scenario I have : browser.alertDetresse("Push button !");
And the custom command is :
exports.command = function(msg, callback) {
this.execute(
function reception(msg){
var r = alert(msg);
});
return this;};
I have the alert message but the message is "undefined".
Thanks in advance for your help,
This is not an issue (you should use mailling list or stackoverflow for questions ...), by the way you must respect the prototype of execute command to pass arguments.
exports.command = function(msg, callback) {
this.execute( function reception(msg){
var r = alert(arguments[0]);
}, [msg]);
return this;
};
Sorry :s And thank you, it worked!
Most helpful comment
This is not an issue (you should use mailling list or stackoverflow for questions ...), by the way you must respect the prototype of execute command to pass arguments.