Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_class_loader.funcs.php on line 55

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_misc.funcs.php on line 5137

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_misc.funcs.php on line 8521

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home3/zeenyxor/public_html/b2evolution1/inc/files/model/_file.funcs.php on line 1442

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home3/zeenyxor/public_html/b2evolution1/inc/files/model/_file.funcs.php on line 1447

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home3/zeenyxor/public_html/b2evolution1/inc/files/model/_file.funcs.php on line 1453

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home3/zeenyxor/public_html/b2evolution1/inc/files/model/_file.funcs.php on line 1460

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home3/zeenyxor/public_html/b2evolution1/inc/files/model/_file.funcs.php on line 1465

Deprecated: define(): Declaration of case-insensitive constants is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/model/db/_db.class.php on line 49

Deprecated: define(): Declaration of case-insensitive constants is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/model/db/_db.class.php on line 50

Deprecated: define(): Declaration of case-insensitive constants is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/model/db/_db.class.php on line 51

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_param.funcs.php on line 2112

Warning: Cannot modify header information - headers already sent by (output started at /home3/zeenyxor/public_html/b2evolution1/inc/_core/_class_loader.funcs.php:55) in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_template.funcs.php on line 379

Deprecated: Function create_function() is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_url.funcs.php on line 817

Deprecated: Function create_function() is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_url.funcs.php on line 818

Warning: Cannot modify header information - headers already sent by (output started at /home3/zeenyxor/public_html/b2evolution1/inc/_core/_class_loader.funcs.php:55) in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_template.funcs.php on line 40

Warning: Cannot modify header information - headers already sent by (output started at /home3/zeenyxor/public_html/b2evolution1/inc/_core/_class_loader.funcs.php:55) in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_template.funcs.php on line 317

Warning: Cannot modify header information - headers already sent by (output started at /home3/zeenyxor/public_html/b2evolution1/inc/_core/_class_loader.funcs.php:55) in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_template.funcs.php on line 318

Warning: Cannot modify header information - headers already sent by (output started at /home3/zeenyxor/public_html/b2evolution1/inc/_core/_class_loader.funcs.php:55) in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_template.funcs.php on line 319

Warning: Cannot modify header information - headers already sent by (output started at /home3/zeenyxor/public_html/b2evolution1/inc/_core/_class_loader.funcs.php:55) in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_template.funcs.php on line 320
Design Patterns in Test Automation: FuzzyVerify
« Quest 2017Design Patterns in Test Automation: MultiWaitForWindows »

Design Patterns in Test Automation: FuzzyVerify

03/31/17

  10:13:00 am, by   , 315 words  
Categories: Uncategorized

Design Patterns in Test Automation: FuzzyVerify


Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home3/zeenyxor/public_html/b2evolution1/inc/plugins/model/_plugins_admin.class.php on line 1466

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home3/zeenyxor/public_html/b2evolution1/plugins/_auto_p.plugin.php on line 502

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home3/zeenyxor/public_html/b2evolution1/plugins/_auto_p.plugin.php on line 500

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home3/zeenyxor/public_html/b2evolution1/plugins/_auto_p.plugin.php on line 500

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home3/zeenyxor/public_html/b2evolution1/plugins/_texturize.plugin.php on line 116

In the last post, we discussed how design patterns can be used in test automation to reduce the level of effort to develop and maintain automated tests. Here is another useful design pattern:

Pattern Name: FuzzyVerify

Problem: Verification steps can be tricky when some part of an entity to be verified contains data that is difficult or impossible to predict. A portion of the text to be verified needs to be masked so that the predictable part of the data can be compared to the expected result. For example, date time stamps and system generated IDs are frequently included in character sequences that also contain data that needs to be validated. While custom validations can be written to parse out unpredictable parts of strings, it is a time-consuming process.

Solution: The solution to the problem must be able to mask out unpredictable parts of the target string in any position in which they might occur.

The following is a proposed solution:

Design Patterns in Test Automation: FuzzyVerify

 The solution assumes that the ExpectedResult parameter will include the ‘*’ in place of characters that should be masked out of the string comparison. The ‘*’ is a wildcard that also serves as a delimiter. It is used to separate the ExpectedResult into a list of strings that are expected to be part of the ActualResult. The loop provides a structure in which to validate that each of the sub-strings in the ExpectedResult are contained in the ActualResult. In this way, the unpredictable parts of the ActualResult are ignored.

Consequences:  In order for this pattern to be used successfully, the caller needs to properly delimit the expected result. If the mask is incorrectly applied, then the comparison will fail. On the other hand, the VerifyStingsWithMasking provides an easy way to build a fuzzy comparator with no application specific requirements. Once it is implemented in the test tool language, it can be reused in any situation.

 Permalink
Deprecated: Function create_function() is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_url.funcs.php on line 817

Deprecated: Function create_function() is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_url.funcs.php on line 818

Deprecated: Function create_function() is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_url.funcs.php on line 817

Deprecated: Function create_function() is deprecated in /home3/zeenyxor/public_html/b2evolution1/inc/_core/_url.funcs.php on line 818

No feedback yet

Zeenyx Software is committed to providing a solution for manual and automated testing that will allow all members of the team to build effective tests faster than with traditional manual testing methods so that a positive Return on Investment is achieved the very first time tests are deployed.

Search

  XML Feeds

blog tool