DMC DMC - 11 days ago 6
Python Question

validate a numerical value with Robotframework/Python

i'm trying to validate whether a numerical value somewhere on a page is between 0 and 40 max for my robotframework/python test using Eclipse.


  • the piece of text that states 'X workitems..' is located within a message/status bar-like component on the bottom of the page, seen below:



screenshot

What is the best practise in handling such scenarios?

Answer

Use the Get Text command or something similar to pull out the string. You will then need to use the String library to retrieve the substring you are looking for, then assert that against your expectations.

That said, the above will be brittle in my view and doesn't sound great approach. Can you get the dev team to output the number you want as an attribute of the element it is part of or somewhere more accessible in general?

Comments