jeudi 4 février 2016

Robot framework Keyword Temlate than test case template

How to use templatize a Robot Keyword than a whole testcase using [Template] syntax?

Need is:

A resource file creates a Keyword in keywords.robot :

*** Keywords ***
Do Something
  [Arguments]    ${arg1}   ${arg2}
  Print args    ${arg1}   ${arg2}

A Robot test case file imports this resource and uses above keyword as:

Resource keywords.robot
*** Test cases ***
Some test case
   Execute test step 1
   Execute test step 2
   Execute test step 3
   #Now use the Keyword defined in resource file with [Template]
   Do Something
   [Template]
    1   2
    3   4

Is there a way to achieve above requirement? As there are test steps which need to be repeated with arguments, not the whole test case. Thanks.

Aucun commentaire:

Enregistrer un commentaire