Reputation: 67
I have a Keyword that returns multiple values, reading from a file. I use it to set some variables like this:
${A} ${B} ${C} ${D} ${E} ObtainVariablesKeyword
Where ObtainVariablesKeyword
has some code and finally:
[Return] ${A} ${B} ${C} ${D} ${E}
The thing is sometimes data is not in a file, instead user write it., So i'd like to run first example row only IF CONDITION.
Does anybody know how?
Run Keyword If CONDITION KEYWORD
does not allow to put variables after condition, because it waits for a keyword.
Upvotes: 1
Views: 2623
Reputation: 96
@{list1}= ObtainVariablesKeyword
@{userlist}= Create List ${uservariableA} ${uservariableB} ${uservariableC} ${uservariableD} ${uservariableE}
${A} ${B} ${C} ${D} ${E}= Run Keyword If @{list1}!=None Set Variable @{list1} ... ELSE Set Variable @{userlist}
Upvotes: 0
Reputation: 3384
One possibility is to create another keyword:
AssignValues
${A} ${B} ${C} ${D} ${E} ObtainVariablesKeyword
And then call this keyword after Run Keyword If
:
Run Keyword if '${flag}'= 'TRUE' AssignValues
Upvotes: 0