Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sum of two variables in RobotFramework

I have two variables:

${calculatedTotalPrice} = 42,42

${productPrice1} = 43,15

I executed

${calculatedTotalPrice}     Evaluate ${calculatedTotalPrice}+${productPrice1}

I got

42,85,15

How can I resolve it?

like image 357
buurkeey Avatar asked Jun 22 '15 08:06

buurkeey


People also ask

How do you add variables in robot framework?

Clicking on New Scalar will open the following screen to create the variable and the value we need to replace with when the variable in used inside test cases. We get ${} for the Name field. The name of the variable is ${url}. The value is − http://localhost/robotframework/login.html.

How do I run multiple tags in Robot Framework?

To run tags in robot framework in the terminal you need to include -i and the Tag name. You can include the path name if your want to only check for tags in that path. If you include the folder name rather than the path it run all tests with that Tag name. Save this answer.

How do I use run keyword and continue on failure?

This keyword returns Boolean True if the keyword that is executed succeeds and False if it fails. ${passed} = Run Keyword And Return Status Should be Equal 1 2 Run Keyword Unless ${passed} Log The previous step FAILED!


1 Answers

the simplest way to add two variables in robotframework without the need to call keywords: you declare it in the VARIABLES sections

*** Variables ***
${A1}               ${1}
${A2}               ${2}
${A3}               ${${A1}+${A2}}

then the output of ${A3} is: 3

like image 67
dema tom Avatar answered Oct 24 '22 16:10

dema tom