ElementComparators allow you to define your own way of verifying that values output from a pipeline and displayed in XNAT are correct. Out of the box, NRG_Selenium comes with support for the following comparators. The "CSV key" is the value that should be used in the spreadsheet to indicate what type of comparator to use:
|ElementComparator||CSV key||Extra config required|
|EqualityElementComparator||"Equals" OR "" OR empty||None|
|PercentToleranceElementComparator (minimum)||"minPercentTolerance"||Minimum percent tolerance allowed (e.g. 1.5)|
|PercentToleranceElementComparator (maximum)||"maxPercentTolerance"||Maximum percent tolerance allowed (e.g. 2.3)|
A quick tip about PercentToleranceElementComparator: the minimum version specifies that the percent error between the values must be greater than some specified value, while the maximum version specifies that the percent error bewteen the values must be less than some specified value. The maximum version is much more useful and logical, but it was easy to include the other version.
If you wish to write your own comparator, simply extend ElementComparator and define a custom version of checkPointsMatch(...). For optimal results, don't throw an Exception when the check fails; instead, simply return any non-null String describing the error, and this will be collected for you and listed at the end with pipeline errors. If the comparator is satisfied correctly, simply return null.