Reputation: 45
I'm trying to multiply variables. I need it's value for a keyword to use. Anyone know how to do it? I only found how to add two variable.
That's what I tried:
${Number}= Run Keyword Evaluate $First * $Second + $Third
Thanks
Upvotes: 3
Views: 10641
Reputation: 125
I was having the same issue and I used:
: FOR ${i} IN RANGE 1 10+1
\ ${Result}= ${no} * ${i}
\ Log ${no} * ${i} = ${Result}
It did not work and gives the error like "*" is not a keyword
Then I used the following and it worked!
: FOR ${i} IN RANGE 1 10+1
\ ${Result}= Evaluate ${no}*${i}
\ Log ${no} * ${i} = ${Result}
Upvotes: 0
Reputation: 385970
You would use Evaluate
, just like you would for any math operator. The problem is that you're using the wrong syntax for variables. Also, you don't need to use run keyword
Here is a working example:
*** Variables ***
${First} 10
${Second} 20
${Third} 30
*** Test cases ***
Example
${result}= Evaluate ${First} * ${Second} * ${Third}
Should be equal as numbers ${result} 6000
Upvotes: 6