Recognition Error Cases

Page Recognition Error Cases

A page is wrongly recognized as MyPage

A page is wrongly recognized as the declared MyPage. In other words, the page unintentionally matches the MyPage recognition criteria.

Solution 1 – Improve MyPage recognition criteria:

Try to modify ‘MyPage’ recognition criteria so the wrongly recognized page doesn’t match the criteria.

Solution 2 – Declare MustExist or MustNotExist Item(s)

Try to detect some components which are only present in MyPage, and declare them as MustExist Items (see MustExist Method or MustNotExist Method).

Solution 3 – For desktop applications

A page is wrongly recognized as MyFirstPage instead of MySecondPage

A page that should be recognized as MySecondPage is wrongly recognized as MyFirstPage, declared previouslz.

This means that the page matches the MyFirstPage recognition criteria.

Solution 1 – Check the declaration of MyFirstPage

Try modifying the declaration of MyFirstPage so that MySecondPage doesn’t match its recognition criteria

Solution 2 – Declare ‘MySecondPage’ before ‘MyFirstPage’

Move MySecondPage so that it is aboveMyFirstPage in the project tree. MySecondPage will then be tested BEFORE MyFirstPage is tested

A Web page is not recognized as MyWebPage in MyApplication but as _Undefined_ in MyOtherApplication

A Web page that should be recognized as MyWebPage in MyApplication is wrongly detected as _Undefined_ in MyOtherApplication. The solution depends on the declaration order of MyApplication and MyOtherApplication.

If MyApplication is declared BEFORE MyOtherApplication:

Solution – Change ‘MyApplication’ recognition criteria.

If MyApplication is declared AFTER MyOtherApplication:

Solution 1 – Change ‘MyOtherApplication’ recognition criteria: Try modifying the declaration of MyOtherApplication so the page in question doesn’t match its recognition criteria

Solution 2 – Declare MyApplication before MyOtherApplication: Move the declaration of MyApplication so that it is above the declaration of MyOtherApplication in the project tree. MyApplication will then be tested BEFORE MyOtherApplication.

A Page declared using UI Automation is not always recognized

A page declared using UI Automation is recognized if the target page is opened when Desktop Agent starts. But it is not recognized if the target page opens after Desktop Agent has started.

This means that recognition criteria are correct, but recognition is not refreshed after Desktop Agent has started.

Solution – Change the page's Refresh mode:

Set the page’s Refresh mode to Window or Polling so that page recognition is performed after Desktop Agent has started (see Subpage Recognition)

Item Recognition Error Cases

A component is wrongly recognized as MyItem

MyItem targets the wrong component.

Solution 1 – Improve MyItem recognition criteria: Try improving the recognition criteria for MyItem so the right component is targeted.

Depending on the technology, you can use one or more of the following methods:

Solution 2 – Use the ‘Occurs’ method: Declare ‘MyItem’ as a multiple item (for details, see Item Definition), and use the right index to target the right component (see Controlling a Multiple Item )

MyItem is not recognized at LOAD time, but is recognized later

When MyPage loads, MyItem is not recognized. After a whilte, it is recognized. This probably means that the content of MyPage is loaded dynamically. At load time, the targeted component is not yet present in MyPage.

Solution 1 – Set MyItem as MustExist

Try setting MyItem as MustExist (see MustExist Method). You will then receive MyPage’s LOAD Event only after MyItem has been created.

Solution 2 – Wait until MyItem is present using the Polling pattern:

Use the Polling pattern to wait until ‘MyItem’ is present (see The ‘Polling’ pattern here: Control Sequences)

MyItem is never recognized

MyItem is never recognized in MyPage. This means that the recognition criteria don’t match.

Solution – Check the recognition criteria for MyItem:

  • Make a new capture of MyPage

  • Try to change MyItem recognition criteria to target the desired component

I have to manage two versions of the same application

I have to control two versions of the same application. MyItem is recognized in one version, but not in the other.

If you cannot find recognition criteria that match in the two versions, you must declare two version of MyItem.

Solution 1 – Change MyItem recognition criteria to match the two versions

  • Make a new capture of MyPage with the second version of the application

  • Try to change MyItem recognition criteria to target the desired component in both versions

Solution 2 – Declare two versions of MyItem

  • Make a new capture of MyPage with the second version of the application

  • Declare MyItem_2 with recognition criteria to target the desired component in the second version

  • In your script, test which version is present:

I have to manage a multilingual application

I have to control a multilingual application. MyItem is declared using a criterion on a label which changes when current language changes.

If you cannot find recognition criteria that are language-independent, update the criteria to match the different languages.

Solution – Change MyItem recognition criteria to match the different languages

  • Make a new capture of MyPage for each language

  • Change the MyItem criterion on the label by adding the different translations using the OR operator