Adding to extracted value to get a new value

2 posts, 0 answers
  1. Misty
    Misty avatar
    3 posts
    Member since:
    Jun 2012

    Posted 25 Jan 2013 Link to this post

    In my OOB Silverlight application, I am extracting a value for current inventory $(QOH) and adding one to the value.  How do I verify the new value of $(QOH) + 1 within a coded step?
  2. Mario
    Mario avatar
    8 posts

    Posted 30 Jan 2013 Link to this post

    Hello Misty,

    Thank you for contacting Telerik Support.

    I believe you will just want to Assert.IsTrue() this particular condition within your coded step.

    Here is an example in which we add 1 to the value of an extracted variable, assert whether this new value is what we would expect and update the extracted variable with the new value.

    int num = Int32.Parse(GetExtractedValue("QOH").ToString());
    Assert.IsTrue(num == expectedValue);
    SetExtractedValue("QOH", num.ToString());

    Please let me know whether my suggestion helps, or if you have any additional questions.

    All the best,
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top