Search code examples
hp-uft

use the checkpoint feature without test step failure


Currently testing a WPF application (SAP Agentry) and trying to determine the status extract the status of a work order in order to perform a test that is appropriate to the work orders status.

Work order status is indicated by an image being visible on the screen.

Does anyone know if HP-UFT has any way of comparing a CheckPoint bitmap with an object on the screen to see if they match, without triggering the test to fail if they do not match.

WpfWindow("Agentry").WpfImage("item").check(CheckPoint("WO-InProgress"))

Limitations of the application:

  • I do not have access to the name of the image (all images have the same properties)
  • There is no isEnabled / isClickable status available (locked and enabled objects both return true for these types of values.

Solution

  • Steps to achieve this result:

    • disable all reporting (thus preventing any failed steps),
    • perform the Boolean check, then take action based on result.
    • Enable the reporting again (allowing pass and failures

    Code:

    Reporter.Filter = rfDisableAll 
    If WpfWindow("Agentry").WpfImage("item").check( CheckPoint("WO-InProgress") ) Then
        currentState = "play"
        'Do actions relating to a in progress work order.
    End If
    Reporter.Filter = rtEnableAll