Forum Discussion

lsainsbury's avatar
lsainsbury
Contributor
11 years ago

Property Checkpoint Code Expression

Hey :)



I have a data-driven loop using an excel spreadsheet, where the Property Checkpoints value changes every loop.



I want to use a code expression to check that the value is between a certain value range in terms of a percent, so for example I'd like to pass my Checkpoints based off our specified value in the spreadsheet being within a value that is anywhere between 10% lower to 10% higher than our base value. I want to use percentages because it is easy to adjust later on rather than specifying default values for every row.



First of all I'd just like to get confirmation that this is possible using a code expression? If so, how would I go about referencing our spreadsheet value in the same way Test Complete does when we create a Property Checkpoint, Condition/Value?



Thanks in advance!



Edit:



So it seems to me I need some expression that references our Object Property (Value in our Software) then compares it against the Spreadsheet value * Value?



Something like...If Object Property < Spreadsheet Value * 1.1 or Object Property > Spreadsheet Value * 0.9?



3 Replies

  • I have managed to get it working using a code expression inside a Property Checkpoint for Value "Project.Variables.StandardNames("Blank Area") * 1.1" with Condition cmpLessorEqual.



    I have a new question, because I'm using a data-driven loop if I use a Code Expression for the Value will it still loop through the values inside of the Spreadsheet?