Testing the Completed Support

In this section you test the Javaboutique toolkit support you have just completed. You do this by analyzing its effect on how UFT views the AllLights control.

You do not have to deploy the toolkit support to UFT again to test it because you changed only Java class files and not configuration files. You can use an open UFT session (running with the Javaboutique toolkit support loaded), but you must close the AllLights application, and run it again, for the changes you made in the custom support to take effect.

  1. Test the new custom support in the Object Spy.

    1. Close the AllLights application and run it again.

    2. Open UFT and load the Java Add-in and the Javaboutique toolkit support.

    3. Open a GUI test and use the Object Spy to view the AllLights properties and methods. The AllLights test object is now named Lights.

    4. Close the Object Spy.

  2. Create and run a UFT test on the AllLights control.

    1. Add the AllLights control to the test object repository.

    2. Create a test that clicks in two locations in the grid, checks that the game is not over, and clicks Restart.

      The test you create looks something like this:

      Note: The ClickLight_replayMethod, does not check the argument values to make sure they are valid. If you provide arguments that are out of bounds (column or row higher than 4) a run-time error will occur.

    3. Run the test and see that it operates correctly (if you defined the checkpoint to check only that the game is not over—it succeeds).

  3. Record operations on the AllLights control.

    1. In UFT, create a new GUI test and select Record > Record and Run Settings to open the Record and Run Settings dialog box. In the Java tab, select Record and run test on any open Java application. If the Web Add-in is also loaded, click the Web tab and select Record and run test on any open browser. Click OK.

    2. Click the Record button or select Record > Record. Click on different locations in the AllLights application: the grid, the RESTART button, and one of the counters.

      When you click in the grid, a ClickLight step is added to the test, with the relevant arguments. When you click the RESTART button, a Restart step is added. When you click anywhere else, no operation is recorded (because you disabled low-level mouse event recording). The recorded test looks something like this:

    3. Click the Stop button or select Record > Stop to end the recording session.

The AllLights custom control is now fully supported, according to the specifications you decided on when planning your custom support.