simplify/implizit variable assignment in robotframework -
consider following robotframework code example:
*** variables *** ${var_1} value ${var_2} value *** test cases *** example ${var_1}= conversion ${var_1} ${var_2}= conversion ${var_2} user keyword ${var_1} ${var_2} desired notation user keyword conversion ${var_1} conversion ${var_2} *** keywords *** conversion [arguments] ${value_to_convert} ${value_to_convert}= catenate ${value_to_convert} foobar [return] ${value_to_convert} user keyword [arguments] ${arg1} ${arg2} log ${arg1} log ${arg2}
question: there possibility simplify working testcase for example only
(non working) desired notation
- or - can somehow use return value of keyword passed parameter without doing explicit assignment before?
for clarification:
some conversion
far more complex , implemented within jrobotremotelibrary- moving assingments
a user keyword
no useful solution, because there many keywords different amount of parameters using same functionality
yes, possible. can write own keywords call other keywords passed in arguments
it this:
*** keywords *** user keyword [arguments] ${keyword1} ${var1} ${keyword2} ${var2} ${var1}= run keyword ${keyword1} ${var1} ${var2}= run keyword ${keyword2} ${var2} log ${var1} log ${var2}
you use keyword in example:
a user keyword conversion ${var_1} conversion ${var_2}
Comments
Post a Comment