Text-display checks

Working with checks that verify expected text in a control.

  1. During a test, you may want to verify that the text displayed in a control is an expected string value. One of the most common built-in actions used for this scenario is, simply, check.

    • Let’s verify that the Available Car text box has the value 6.

    • We write the following test:

    • If the verification succeeds, the check reports a Passed message; otherwise, it reports a Failed message.

  2. The check control property action captures the value of a specified property from a control, then compares it against an expected value. For this built-in action, you usually need to pass a property such as caption or value to the property argument.

    • For example, let’s verify that the Home button is displaying the text Home properly. To accomplish this, pass thecaption property into the property argument of the check control property.

    • We create the following test procedure:

    • If the verification succeeds, the check control property reports aPassed message; otherwise, it reports a Failed message.

  3. To verify the contents of a tooltip of a control, use check control tooltip, which captures the tooltip text and compares it against an expected string.

    • For example, you may want to verify that a tooltip is displayed properly when the cursor is hovered over the Available car text box:

    • We create the following test procedure:

    • If the verification succeeds, check control tooltip reports a Passed message; otherwise, it reports a Failed message.

  4. To verify that a regular expression finds a match in a specified text string, use the built-in action check pattern to check whether a string of text conforms to the specified pattern. To check whether the caption property of a control matches a given regular expression, the check pattern in text action is used.

    • For example, say we want to validate the format of an email address entered in the Email text box of a registration form.

    • We create the following test procedure, which includes a regular expression which, if satisfied, assures us that the string it matches is a valid form of email address:

    • If the verification succeeds, check pattern in text reports a Passed message; otherwise, it reports a Failed message.

  5. To verify the existence of an item in a pop-up menu, use the action check context menu item exists.

    • For example, suppose we want to check the existence of the Show artist item in a pop-up menu.

    • We create the following test procedure:

    • If the verification succeeds, check context menu item exists reports a Passed message; otherwise, it reports a Failed message.

  6. In some cases, text in an AUT object may be part of a bitmap, rather than a distinct property value. In such cases, you can use one of the Optical Character Recognition (OCR) actions to check the text against an expected value. (See Optical Character Recognition checks.)


Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400