Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Attribute Matching

TRAINING GUIDE

Version 6.2

BluePrism.com
Commercial in Confidence Attribute Matching | 1
The training materials and other documentation (“Training Materials”) provided by Blue Prism as part of the training course are
Blue Prism’s Intellectual Property and Confidential Information. They are to be used only in conjunction with the Blue Prism
Software which is licensed to your company, and the Training Materials are subject to the terms of that license. In addition, Blue
Prism hereby grants to you a personal, revocable, non-transferable and non-exclusive license to use the Training Materials in a
non-production and non-commercial capacity solely for the purpose of training. You can modify or adapt the Training Materials
for your internal use to the extent required to comply with your operational methods, provided that you shall (a) ensure that
each copy shall include all copyright and proprietary notices included in the Training Materials; (b) keep a written record of the
location and use of each such copy; and (c) provide a copy of such record to Blue Prism on request and allow Blue Prism to verify
the same from time to time on request.

For the avoidance of doubt, except as permitted by the license or these terms, you cannot (a) copy, translate, reverse engineer,
reverse assemble, modify, adapt, create derivative works of, decompile, merge, separate, disassemble, determine the source code
of or otherwise reduce to binary code or any other human-perceivable form, the whole or any part of the Training Materials; (b)
sublease, lease, assign, sell, sub-license, rent, export, re-export, encumber, permit concurrent use of or otherwise transfer or
grant other rights in the whole or any part of the Training Materials; or (c) provide or otherwise make available the Training
Materials in whole or in part in any form to any person, without prior written consent from Blue Prism.

© Blue Prism Limited, 2001 - 2019

All trademarks are hereby acknowledged and are used to the benefit of their respective owners.
Blue Prism is not responsible for the content of external websites referenced by this document.

Blue Prism Limited, Cinnamon Park, 2 Crab Lane, Warrington, WA2 0XP, United Kingdom
Registered in England: Reg. No. 4260035. Tel: +44 370 879 3000. Web: www.blueprism.com

Commercial in Confidence Attribute Matching | 2


Contents
1 Introduction ................................................................................................................................................................................................. 4
2 Attributes ...................................................................................................................................................................................................... 4
2.1 Attribute Match Type ............................................................................................................................................................................... 4
2.2 Match Type: Equal (=) ............................................................................................................................................................................ 4
2.3 Match Type: Wildcard (*) ...................................................................................................................................................................... 5
2.4 Match Type: Not Equal (<>) ................................................................................................................................................................ 7
2.5 Match Type: Numeric (<, <=, >, >=).............................................................................................................................................. 7
2.6 Match Type: Dynamic .............................................................................................................................................................................. 8
3 Matching Exercises ................................................................................................................................................................................... 8
4 Dynamic Attribute Matching.............................................................................................................................................................. 10

Commercial in Confidence Attribute Matching | 3


1 Introduction
This module is intended to supplement the Blue Prism Foundation Training course and is aimed at students who
have completed the course and are beginning to put their education into practice.

2 Attributes
Application Modeller extracts characteristic information about an element from a target application; this
information is known as an attributes list.

Once captured, this information can enable a Business Object to “remember” an element, and it does this by
using a selection of attributes as the “fingerprint” of an element. This fingerprint is then used to identify and
interact with the element from the Object Studio diagram.

2.1 Attribute Match Type


You will recall from Foundation training, that in Application Modeller, we checked and un-checked the Match
column to change our selection of match attributes included in the element fingerprint.

Next to the Match column, there is a column named Match Type;

Figure 1: Application Modeller Attributes List

By default, the Match Type column is set to ‘= (Equal)’ for all attributes, however, there are other options
available. These additional options provide flexibility in how Application Modeller uses the attributes included
in the element fingerprint.

2.2 Match Type: Equal (=)


This is the most commonly used Match Type and default assigned to each element in Application Modeller.

This Match Type will perform a simple full value/phrase match against the target element attribute value.

Commercial in Confidence Attribute Matching | 4


Figure 2 displays the Window Title from the target application ‘Centrix Data Solutions’, which is identified in
Application Modeller as the Window Text attribute (assuming Win32 spy mode has been used).

Figure 2: Centrix Data Solutions

Based on Figure 2, to achieve a positive match using the Match Type ‘= (Equal)’, the value in Application
Modeller to match, must be equal to “Centrix Data Solutions – Please Log In”.

Figure 3: Application Modeller Window Text match criteria

2.3 Match Type: Wildcard (*)


The Wildcard Match Type allows you to perform a fuzzy match. Fuzzy matching is a technique which allows you
to identify non-exact word or phrase matches when performing an attribute match.

Key Point

• There are 3 important operators which are used when performing a Wildcard or Fuzzy match.
These are;
▪ * - Matches against a wildcard expression in which * represents any or no characters
▪ ? - Matches against a wildcard expression in which ? matches any single character
▪ # - Matches against a wildcard expression in which # matches any single number

Commercial in Confidence Attribute Matching | 5


Figure 4 and figure 5 show 2 different versions of the same software, which is highlighted in the Window Text of
the application.

Figure 4: Centrix Data Solutions V1.2.999 Figure 5: Centrix Data Solutions V1.2.1000

If we configured Application Modeller to match on the Window Text attribute as Match Type ‘= (Equal)’, the
Business Object would no longer recognize the log in form if a software update was installed. To get around
this, we can deploy the Wildcard Match Type.

Figure 6 and 7 below demonstrates a Wildcard match using the * operator;

Figure 6: Matching Window Text attribute which begins with ‘Centrix Data Solutions – Please Log In’

Figure 7: Matching Window Text attribute which contains ‘Centrix Data Solutions’

Figure 8 below demonstrates a Wildcard match using the # operator;

Figure 8: Matching Window Text attribute which begins with ‘Centrix Data Solutions – Please Log In (V1.2.’,
with the last 5 characters being any numbers 4 numbers, followed by a close bracket

Commercial in Confidence Attribute Matching | 6


Figure 9 below demonstrates a Wildcard match using both the ? and # operators;

Figure 9: Matching Window Text attribute which begins with ‘Centrix Data Solutions – Please Log In
(‘, followed by any single alpha character, following by ‘1.2.’, with the last 5 characters being any numbers 4 numbers,
followed by a close bracket

2.4 Match Type: Not Equal (<>)


The Not Equal Match Type is the opposite of the Equal Match Type. The Not Equal Match type will perform a
simple full value/phrase match against the target element attribute value and will return a positive match only if
the value is not matched.

2.5 Match Type: Numeric (<, <=, >, >=)


The Numeric Match Type enables you build match criteria based on Numeric attribute values such as Length
and Width.

Key Point

• There are 4 numeric operators available when performing a Numeric Match Type.
These are;
▪ > (Greater Than)
▪ >= (Greater Than or Equal)
▪ < (Less Than)
▪ <= (Less Than or Equal)

Figure 10 below demonstrates how to match the Width attribute only when it is greater than 100;

Figure 10: Matching Width attribute when it is greater than (>) 100

Commercial in Confidence Attribute Matching | 7


2.6 Match Type: Dynamic
Dynamic Match Type enables matching on values which may change. The match value for a Dynamic match can
be set a runtime by referencing a value stored in a standard data item which can be updated by process logic.

Dynamic matching is discussed further in section 3 of this guide.

3 Matching Exercises
Exercise 3.1.1 Wildcard Matches

• Create a Business Object named ‘Attribute Match Types Test’ which automates the Microsoft Paint
application (C:\Windows\system32\mspaint.exe).

• Using Win32 mode, spy the main window (whose title is usually untitled – paint)

Figure 11: Microsoft Paint Main Window Highlighted

• Click Highlight to ensure your match is unique. Adjust the matching attributes appropriately if more
then one element match is identified.

• Change the Window Text attribute match type to Wildcard with the value *Paint and click Highlight
again.

• Modify and save the drawing in Microsoft Paint – notice the window title has changed.

• Does your element match still work with a Wildcard?

Commercial in Confidence Attribute Matching | 8


• Change the match type back to Equal. Does it still match?

Exercise 3.1.2 Numeric Matches

• Open a dialog box in Microsoft Paint, such as the Image Properties windows. In Windows 10, you can
access the Image Properties dialog through File > Properties.

Figure 12: Microsoft Paid Image Properties window

• Using Win32 mode, spy the Image Properties dialog.

• Locate the Width attributes from the attributes list.

• Using the Width attribute, experiment with the Numeric match type operators (>, >=, <, <=) to see
how these can be used to match elements of Numeric type.

Exercise 3.1.3 Not Equal Matches

• Think of your own method of testing using this match type.

Commercial in Confidence Attribute Matching | 9


4 Dynamic Attribute Matching
The Dynamic match type allows us to specify the value of an attribute from the Business Object flow diagram
rather than use the one in Application Modeler. When we mark an attribute as Dynamic we are essentially
telling Application Modeler, “Don’t use your value for this attribute, use the value the flow diagram is going to
give you.”

Dynamic attribute matching is enabled in Application Modeller for the relevant attribute.

Figure 13: Application Modeller Dynamic Match Type

Once Dynamic has been selected as the Match Type for the attribute in Application Modeller, the Value column
becomes locked. This is because the value to match will be provided from the Business Object flow diagram.

A common example of using the Dynamic Match type is when you need to match against a value held in a Data
Item which is provided by the process as an input parameter; for example an “Account Details” window may
contain the customer name or customer ID in the Window Title. This information will not be known until
process run-time, therefore the Equals Match Type is ruled out and Dynamic Match Type is employed.

When an attribute match is made Dynamic, the match value needs to be supplied on the fly (during the
process run), each time that element is used, whether it be a Read, Write, Navigate, or Wait stage.

As with all other attribute match types, Dynamic matching can be used on multiple attributes of a single
element;

Figure 14: Application Modeller Dynamic Match Type

Commercial in Confidence Attribute Matching | 10


Both values to match against the Window Text attribute and the Class Name attribute, will be provided on
the fly.
A Dynamic attribute can be thought of as a mandatory input parameter required by any stage using the
element. To continue the example of customer details making up part of a window title, the expression
might look like the following:

“Account Details for “ & [Customer Name] & “ (“ & [Customer ID] & “)”

The value to match when using Dynamic matching is configured within the Properties window for each of
the stages which need to use the element. The normally disabled parameters button (Params for short) in
the stage properties widow becomes enabled whenever an element with dynamic matching is used.

Figure 15: Dynamic Match Params button enabled

Clicking on the Params button will open the “Element Properties” window, where you can assign the
attribute match values.

Figure 16: Dynamic Match Element Parameters window example

The Expression Editor window is available to help build your attribute match value. The Expression Editor
window is opened from within the Element Properties window by clicking on the usual icon.

Figure 17: Expression Editor icon

Commercial in Confidence Attribute Matching | 11


Exercise 4.1.1 Using the Dynamic Match Type

• Open the ‘Centrix Data Solutions – Basic Actions’ Business Object and open Application Modeller.

• Add a new element and spy the Staff Number field as you did before.

Remember that we need to include a match on the Ordinal attribute to be able to distinguish
between the Staff Number and the Password field.

• Change the Match Type of the Ordinal attribute to Dynamic. Note the Value column has become greyed
out and locked from input. This is because the match value must be provided from the flow diagram at
run-time.

• Create a new Write stage to write “Hello” to the new element. In the Write properties, see how the
button in the Params column is enabled when you drag in the new element.

Figure 18: Dynamic Match Params button enabled

• Press the Params button to open the Application Element Parameters window and enter the value “99”.

Figure 19: Dynamic Match using the Ordinal attribute

• Run the page and see if the Write stage works as expected.

The Write stage fails because Application Modeller cannot find any element with matching attributes. The value
of Ordinal is being supplied by the Write stage and, in this scenario, is providing a spurious value.

Commercial in Confidence Attribute Matching | 12


• Change the Dynamic Match value for the Ordinal attribute in the Write stage to 5, and check that the
page now runs correctly.

• Now copy the Write stage and paste as another Write beneath the first.

• Edit the new Write stage so that the dynamic attribute value for the Ordinal attribute has the value of 4.

• Go to the Centrix Data Solutions Log In window and manually clear the Staff Number field.

• Run the page again. What has happened?

The second Write stage has written to the Password field. Effectively, the second Write stage has said
to Application Modeller, “Find the element using 4 as the value of the Ordinal attribute.” and because
we have stipulated Ordinal 4 as the Write stage Params for the attribute, Application Modeller has
found the Password field, not the Staff Number field.

Commercial in Confidence Attribute Matching | 13


5 Attribute Matching Strategy
As target application technology and design varies so widely, it is impossible to define a strategy to employ in
relation to element attribute match selection; there is no ‘one size fits all’.

Some general guidelines to be mindful of when selecting match attributes are;

• Carefully select match elements which uniquely and robustly identify your target element, using least
is best approach.

• Avoid using attributes which are potentially inconsistent, such as Path, X, Y, Parent X, Parent Y,
Class etc.

• Deselect any unused / unrequired match attributes or attributes with a NULL (Blank) values.

• Experiment with different Spy modes to find the most effective method of identifying an element.

• The Ordinal, Match Index and Match Reverse attributes are very effective in establishing unique
element matches.

Commercial in Confidence Attribute Matching | 14

You might also like