cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between ordinal and match index

NiteshGoyal
Level 3
What is the difference between Ordinal and match index when we spying the elements? In which case we should use Ordinal and in which case Match index?
11 REPLIES 11

John__Carter
Staff
Staff
Ordinal is just an attribute from within the application, much like any other. Match Index is a BP setting that tells Application Modeller to stop searching the application once it has found the nth matching element.

PrateekMehan
Level 6
Ordinal is the order in which the elements were made during the application development and Match Index John has pointed out correctly.

John__Carter
Staff
Staff
Ordinal is OK but I don't entirely trust it for all applications - I've had experience of it being an unreliable or inconsistent identifier.

PrateekMehan
Level 6
Yea John, Order is disturbed when application goes under maintenance or when new build of application has been imposed.

SagarMehta
Level 3
Thank you Prateek and John. We are facing similar issue where the ordinal keeps changing every time a new built is created. Do you think match index is better choice in this case? what other option do we have?

harathi_salla
Level 3
Hi, Can you give one example on both match index and ordinal ?

John__Carter
Staff
Staff
Match Index is a value created by BP and it means 'give me the Nth element matching my chosen attributes'. Match Reverse is similar and means 'search the application in reverse order'. Ordinal is a value created by the target application, that means 'this is the nth child element within the parent element'. However experience has taught me not to trust that Ordinal will be consistent; often it depends on the behaviour of the application.

harathi_salla
Level 3
Thanks John, So, there is concept of duplicate items when using ORDINAL. (In case of match index, we may found duplicates and we tell BP to find the Nth element when duplicates found.)

John__Carter
Staff
Staff
Adi - yes, Ordinal has nothing to do with uniqueness, it's just an index number. Often this number is constant but in some apps it is unreliable as part of your element identification. Match Index is an instruction to BP to take the Nth matching element and ignore any other matches. Match Reverse make the search go bottom->up instead of the default top->down.