Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robot Framework Absolute Value (number)

Looking for a way how to represent the modulus/absolute value in Robot Framework. Is it abs() ? or ${variable}.abs()? How I can make my ${variable} with negative value -15 to be +15

Like this: |-15| = 15

like image 378
user2988257 Avatar asked Dec 05 '22 02:12

user2988257


1 Answers

You need to use Evaluate keyword to run abs function to your number:

*** Variables ***
${neg num}     -15

*** Test Cases ***
Absolute
    Log    ${neg num}
    ${num}=    Evaluate    abs(${neg num})
like image 175
Pekka Avatar answered Dec 28 '22 06:12

Pekka