Fuzzy Verification

There are situations when Silk Test Classic cannot see the full contents of a control, such as a text box, because of the way that the application paints the control on the screen. For example, consider a text box whose contents are wider than the display area. In some situations the application clips the text to fit the display area before drawing it, meaning that Silk Test Classic only sees the contents that are visible; not the entire contents.

Consequently, when you later do a VerifyProperties against this text box, it may fail inappropriately. For example, the true contents of the text box might be 29 Pagoda Street, but only 29 Pagoda displays. Depending on how exactly the test is created and run, the expected value might be 29 Pagoda whereas the value seen at runtime might be 29 Pagoda Street, or vice versa. So the test would fail, even though it should pass.

To work around this problem, you can use fuzzy verification, where the rules for when two strings match are loosened. Using fuzzy verification, the expected and actual values do not have to exactly match. The two values are considered to match when one of them is the same as the first or last part of the other one. Specifically, VerifyProperties with fuzzy verification will pass whenever any of the following functions would return TRUE, where actual is the actual value and expected is the expected value:

  • MatchStr (actual + "*", expected)
  • MatchStr ("*" + actual, expected)
  • MatchStr (actual, expected + "*")
  • MatchStr (actual, "*" + expected)

In string comparisons, * stands for any zero or more characters.

For example, all the following would pass if fuzzy verification is enabled:

Actual Value Expected Value
29 Pagoda 29 Pagoda Street
oda Street 29 Pagoda Street
29 Pagoda Street 29 Pagoda
29 Pagoda Street oda Street

Enabling fuzzy verification

You enable fuzzy verification by using an optional second argument to VerifyProperties, which has this prototype:

VerifyProperties (WINPROPTREE WinPropTree [,FUZZYVERIFY FuzzyVerifyWhich])

where the FUZZYVERIFY data type is defined as:

type FUZZYVERIFY is BOOLEAN, DATACLASS, LIST OF DATACLASS

So, for the optional FuzzyVerifyWhich argument you can either specify TRUE or FALSE, one class name, or a list of class names.

FuzzyVerifyWhich value

FALSE (default)
Fuzzy verification is disabled.
One class

Fuzzy verification is enabled for all objects of that class.

Example window.VerifyProperties ({…},Table) enables fuzzy verification for all tables in window (but no other object).

List of classes

Fuzzy verification is enabled for all objects of each listed class.

Example window.VerifyProperties ({…}, {Table, TextField}) enables fuzzy verification for all tables and text boxes in window (but no other object).

TRUE

Fuzzy verification is enabled only for those objects whose FuzzyVerifyProperties member is TRUE.

To set the FuzzyVerifyProperties member for an object, add the following line within the object's declaration:

FUZZYVERIFY FuzzyVerifyProperties = TRUE

Example: If in the application's include file, the DeptDetails table has its FuzzyVerifyProperties member set to TRUE:

window ChildWin EmpData
. . .
   Table DeptDetails
     FUZZYVERIFY FuzzyVerifyProperties = TRUE

And the test has this line:

EmpData.VerifyProperties ({...}, TRUE)

Then fuzzy verification is enabled for the DeptDetails table (and other objects in EmpData that have FuzzyVerifyProperties set to TRUE), but no other object.

Fuzzy verification takes more time than standard verification, so only use it when necessary.

For more information, see the VerifyProperties method.

Defining your own verification properties

You can also define your own verification properties.