Working with Screen Controls: Tips and Best Practices

It is recommended to adhere to the guidelines in the following sections to ensure that the automation proceeds smoothly.

Building the Repository

The Repository Object section of the Screen Capture Tool (Using the Screen Capture Tool) is editable. Before copying the content to the repository, it is recommended to update the ProgId value of the object. This is particularly important when the image is used as an anchor.

To avoid errors, it is recommended to copy and paste the binding attributes from the Repository Object section of the Screen Capture Tool into the Repository.xml file.

When working with screen controls, resolution and color depth have an extensive effect on matching success. Images therefore need to be taken in the same resolution and color depth at which they are going to be matched in runtime.

To help ensure successful image matching, it is recommended to capture several images for the same control, each at a different color depth and resolution. In runtime, JIA's Resolution Manager will select the most appropriate image for matching. (There is no need to modify the project code in any way.) For details about setting up mulitple images in the Repository, refer to The Screen Control Repository Object.

To make the Repository easier to maintain, define the image path of the screen controls relative to the project path. (For example, ImgIdentifierPath="..\..\Images\YesButton.png.

Preparing for Deployment

To avoid losing images when performing deployment, all images should be saved under the Release folder.

Runtime Practices

When automation is running, the image should be on top. JIA will attempt to bring the parent window of the control to the front, but if there is an application that is topmost (e.g., a modal window), automation will fail.

When automation is running, the image should be unique on the screen.