Verification math?

2 posts, 0 answers
  1. Si
    Si avatar
    4 posts
    Member since:
    Oct 2018

    Posted 26 Nov 2018 Link to this post


    I'm trying to verify calculations done against the inputs in certain text boxes. Is there a way to do this?


    For example 

    Text Box 1 = 5.43

    Text Box 2 = 6.00

    Text Box 3 = 11.43


    I need to be able to verify that the calculation (in this case a sum) of Text Box 1 and 2 are correct in #3, not matter what the value of Text Boxes 1 and 2 are.




  2. Elena
    Elena avatar
    1188 posts

    Posted 27 Nov 2018 Link to this post

    Hello Si,

    Test Studio allows you to extract the value of any element to a variable and then use it later in the test as per the requirements. In this scenario you could use the variables extracted from Box 1 and Box 2 in a coded step to get their sum stored to a third variable. For this you will need how a variable is set in code.

    Then, you can use the last variable, which represents the sum, back in the test steps and data bind the verification step to verify the value of Box 3. Please note that the variable set in code will not be present in the step property UI, but still you can use it - please see point 10. in this article

    I hope the above approach will suit your needs. Of course, if you have any questions, please do not hesitate to get back to me. 

    Elena Tsvetkova
    Progress Telerik
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top