You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently it's seem not possible to pass not primitive arguments to javascript code. Example:
in .tsv file:
${Name} = Set Variable MyName
${Surname} = Set Variable MySurname
${Person} = Create List ${Name} ${Surname}
Execute Javascript showPerson('Mr.', ${Person}); # This is wrong for sure
And in the html file opened in a browser the Javascript function
function showAlert(title, person) {
alert('You are ' + title + ' ' + person[0] + ' ' + person[1] );
}
Obviously in this case we can change the array "person" with two distinct parameters and solve the problem, but in case of complex objects it is not possible.
A possible enhancement could be an additional keyword
Execute Javascript With Arguments code *args
Where "code" is just a single line of code (previously joined at tsv level if needed) and args is variadic.
Hi,
currently it's seem not possible to pass not primitive arguments to javascript code. Example:
in .tsv file:
And in the html file opened in a browser the Javascript function
Obviously in this case we can change the array "person" with two distinct parameters and solve the problem, but in case of complex objects it is not possible.
A possible enhancement could be an additional keyword
Where "code" is just a single line of code (previously joined at tsv level if needed) and args is variadic.
The implementation could be very similar:
Equivalent implementation for the Asynchronous version of the keyword.
What do you think?
The text was updated successfully, but these errors were encountered: