Image Based Action Operation

Applies to TestComplete 14.72, last modified on April 22, 2021

Description

Use the Image Based Action operation to simulate various actions over the control or screen area specified by its image in the Image Repository collection. For example, you can simulate touching a control on a mobile device screen or clicking an icon on the PC desktop.

Requirements

The operation does not have any specific requirements.

However, to use the operation to simulate user actions on a mobile device, you will need:

  • A license for the TestComplete Mobile module.

  • The Mobile module’s plugins must be enabled in TestComplete.

In addition, to check images on iOS devices, your iOS application must be prepared for testing and running. Otherwise, TestComplete will not have access to the iOS device’s screen.

Operation Result

The operation returns the same value, which the called method returns. For information on how to obtain the result value, see Checking Operation Result.

Scripting Analogue

The operation is an analogue of calling a method of the appropriate ImageSetItem object from script.

Child Operations

The operation cannot have child operations.

Operation Parameters

The operation has the following parameters:

  • The name of the item in the Image Repository over which you want to simulate a user action.

  • The name of the method to call.

  • The method’s parameters, if any.

Specifying parameters when adding the operation

When you add the operation to your keyword test, TestComplete displays a wizard that lets you specify all these parameters:

Select Image

On this page, you select an image that the operation will search for on your PC desktop or mobile device screen. You can either select an existing image from your Image Repository, or capture the image from the screen:

To select an existing image:

  1. From the Image Set drop-down list, select the image set that has the needed image.

  2. The wizard will show the list of the image set’s images. Select the needed image and click Next.

To capture a new image:

  1. Click Capture New Image.

  2. TestComplete will call the Add Image to Image Repository wizard.

  3. Follow the wizard instructions to capture the needed image on your PC desktop or on the mobile device screen.

    Note: To capture the image from a mobile device screen, connect your device to TestComplete. To learn how to do it, see —

    Connecting TestComplete to Android Devices

    Preparing Applications, Devices, and Test Computers for iOS Testing

    In addition, to access the screen of your iOS device, your tested application must be prepared for testing and running on the device.

Select Method or Property

On this page, you select a method that you want to call to simulate a needed user action over the found UI element. You can find the description of the available methods in Simulating Basic User Actions in Image-Based Tests.

To find the needed method faster, you can type a part of its name in the Quick Search edit box. The wizard will filter out the method list and show only the methods that match the text you are typing.

Operation Parameters

On this page, you specify parameters of the method that the operation will call. For information on parameters, see the appropriate method description —

ImageSetItem Object Methods

Modifying Parameters

After adding the operation to the test, you can modify the operation parameters with the same wizard that you used to add the operation. To invoke the wizard, simply double-click the operation’s row in the Keyword Test editor.

To modify parameters of the operation, you can also use the in-place editors and dialogs provided by the Keyword Test editor.

See Also

Test Actions Category
Specifying Operation Parameters
Checking Operation Result
Call Object Method Operation
Image-Based Testing

Highlight search results