buurkeey
buurkeey

Reputation: 369

Robot Framework - Run Keyword If with Execute Javascript

I'm trying to execute javascript and returning a value with run keyword if or something like that. But it gives error as expected. How can I pass this situation. Example code block:

Run Keyword If '${COUNTRY}'=='ES' ${income} Execute Javascript return $('#income').val();

Upvotes: 0

Views: 558

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 386352

"Run keyword if" requires a keyword after the condition; you've specified a variable name. To save the result of the keyword, the variable name must be in the first cell of the row:

${income}    run keyword if    '${COUNTRY}'=='ES' 
...    Execute Javascript return $('#income').val();

Upvotes: 3

Related Questions