I'm trying to find the lowest value in the list using Robot Framework. I have written custom keyword in python as below:
def Minimum_Value_from_list(self, list_):
return min(list_)
I have executed the below RF script
Find lowest value
@{list}= Create List 3 5 9 16 31 42 66 75
Log List ${list}
${LowValue}= Minimum_Value_from_list ${list}
It shows the output(minimum value) as 16 which is not correct.
Any inputs/suggestion would be helpful to get the correct output
By default, robot will pass the values as strings. You'll need to convert them to integers before getting the minimum value.
If you can safely assume all of the values are indeed integers, one way to do it would be with a list comprehension:
return min([int(x) for x in list_])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With