This is a migrated thread and some comments may be shown as answers.

Adding to extracted value to get a new value

1 Answer 30 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Misty
Top achievements
Rank 1
Misty asked on 25 Jan 2013, 08:07 PM
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?

1 Answer, 1 is accepted

Sort by
0
Mario
Telerik team
answered on 30 Jan 2013, 06:17 PM
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());
num+=1;
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,
Mario
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Misty
Top achievements
Rank 1
Answers by
Mario
Telerik team
Share this question
or