TestProject Forum

Validating a number value in an element within a range

So there’s an element I’m wanting to check if the number is within a certain range. For example the element will have “2,600 words”. I want to check if the 2,600 portion is within the range of 2,500-5,000.

It can be achieved with 3 steps

Read the text from the element/desired attribute → convert the text to number → apply a condition or multiple conditions (or a validations).

  1. Use get text action save the value in parameter (P1)
  2. Use convert string to number action to get read from all non numeric characters in your parameter (save the result to the same parameter P1)
  3. On the convert string step add a validation P1<15000 , add another validation P1>5000
    In this case I looking to validate the 12345 number

Here how it will look like in the online recorder

image

1 Like

Hello Mark, thanks for the reply. I’m not seeing the “Convert String to Number” action?
image

Hello @Chris.Rye
This action is part of String Utils Addon.

Can you please check if you have an update to this addon in the Addons tab?

Guess I might just need to update?

Yes :slight_smile:
Then you will find it.

1 Like

Yep that worked, thank you!