Screen matching

Top  Previous  Next

The 'match' property

 

The match property represents the matching criteria between the underlying host screen and an expression specified under this property, allowing HostSurfer to determine which rule applies to each screen.

 

The match property needs one or more matching criteria expressions to identify a host screen. At run-time, and for each received host screen, HostSurfer evaluates the complete matching rule-set collection and selects the one that best matches the underlying screen data.

 

 

The matching criteria can be:

 

1. A simple string constant which have to be present on the screen. This is the laziest way to identify a host screen, and must be used with caution.

Example:

 

match: "GENERAL ACCOUNT INFORMATION"

 

2. A JSON array with one or more matching objects, where each object defines the row and column coordinates where to locate the origin of the text within the screen, and the string constant the text will be compared to.

Example:

 

match: [

           { text: "GENERAL ACCOUNT INFORMATION", row: 1, col: 27 },

           { text: "PURCHASE LIMIT.....................:", row: 6, col: 3 }

       ],

 

3. A Javascript function, that takes the HostSurfer object instance as the only parameter and returns a Boolean value indicating the result of the matching criteria.

Example:

 

match: function (hs) { return (hs.getText(19,55,8) == 'USERNAME')},