Testing custom Java controls using the RFT GetProperty and Invoke methods

Source: Internet
Author: User
Tags gettext

Introduction: Custom Java controls (or controls not contained in the standard Java library) are challenging the GUI automation testing process. This article explains how to use these control classes through the two methods provided by IBM Rational functional Tester to create automated processes: GetProperty and invoke.

The Ibm®rational®functional Tester provides a standard interface to facilitate the operation of standard Java™ controls. For example, in the Rational Textguitestobject interface, you can easily get/set a swing text box using the GetText and SetText methods. On the other hand, it is difficult for any GUI automation tool to automate non-standard or custom controls, including Rational functional Tester. Custom controls do not exist within standard parts (for example, AWT or Swing), but they are created by the continuous accumulation of application developers. The Rational functional Tester developers do not know these controls and cannot anticipate the methods you need, so they cannot provide an interface that contains all the methods. To test these interfaces, you need to get information directly from the control itself about how the control works. Luckily, Rational functional tester provides us with a way to use the GetProperty and invoke methods.

The Java applet is an instance of a custom control, as shown in Figure 1. This is the Editor applet included in Lotus Notes.

Figure 1. Lotus Notes Editor Applet

This applet shows the area where the user enters Rich text (which can set text to bold, italic, text color, and so on). Users control the display of text by using buttons and list boxes on the top applet. These buttons are not standard controls. That is, they are not part of Swing or AWT buttons, but are Lotus developers. Their packages and class names, Com.lotus.app.MultiImageButton, show this. Obviously, the class in this package is not a standard control, so Rational functional Tester cannot provide all the interfaces that you need.

However, even if these buttons are not standard controls, Rational functional Tester can still use the most common classes to identify them, that is, Guitestobject. In most cases, however, this does not satisfy the requirements. The problem is that, in contrast to the Guitestobject classes that are provided directly, you need more information about the controls and more ways to manipulate them. For example, although Guitestobject provides a way to click a button, it does not provide a way to get the button name (for example, to distinguish the bold and italic buttons) GetText and it does not provide a isselected method to determine whether a particular button has been selected. But these are the information that is necessary to thoroughly test the applet. Therefore, you have to use the GetProperty and invoke methods of the Rational functional Tester to get information directly from the control.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.