14 Using the Image Based Recording Functional Test Module

This chapter provides instructions on configuring and using the OpenScript Image Based RecordingFunctional Test Module, which provides support for functional testing of applications based upon screen capture images.

14.1 About the Image Based Recording Functional Test Module

The Image Based Recording Functional Test Module is an extension module to the OpenScript Web Functional Test Module that extends the Web testing with support for functional test record/playback of applications using captured screen images.

Image Based Recording components are image based screen captures and the Image Based Recording Functional Test Module provides the image/attribute information for OpenScript to record interactions with the image captures. Actions will be recorded in the test script as OpenScript "img" commands. Other components can be standard Web controls which are captured as standard OpenScript "web" and "ft" navigation commands.

The Image Based Recording Functional Test Module provides a toolbar button that lets you insert actions and tests based upon screen captures to the script view.

OpenScript plays back recorded Image Based Recording actions/commands which consist of a target image identified by its attributes plus the action to perform (for example: img.target("{{@resourceFile(ImageLib/0.png)}}", 35, 29, 0.9, "Click Browser").click();. The actions used for playback will specified manually in the Java Code view. Unattended playback is supported through Oracle Test Manager or third-party tools using OpenScript's command line interface.

The Image Based Recording Functional Test Module uses the OpenScript playback and iterate toolbar buttons which allows users to start the script playback for either a single playback through the script or multiple iterations using data from a databank file. Playback results for Image Based Recording functional test scripts can be viewed in the Results and Console views

14.1.1 Key Features of the Image Based Recording Functional Test Module

  • The Image Based Recording Functional Test Script Module. The New Project wizard (New from the File menu) includes an "Image Based Recording" option in the Functional Test Group to use when creating Image Based Recording functional testing projects in OpenScript.

  • Image Based Recording Functional-Specific Application Programming Interface (API). The Image Based Recording Functional Test Module includes an Image Based Recording Functional Test Module API Specification that can be used to customize Image Based Functional test-specific scripts.

14.2 Setting Preferences

This section decribes setting Image Based Recording record and playback preferences.

14.2.1 Setting Image Based Recording Functional Test Record Preferences

To set Image Based Recording Functional Test record preferences:

  1. Start OpenScript.

  2. Open or record an Image Based Recording script.

  3. Select OpenScript Preferences from the View menu.

  4. Expand the OpenScript node and the Record category.

  5. Select Image Based Recording.

  6. Click the tab and set the preferences. See Section 2.5.4, "Image Based Recording Record Preferences" for descriptions of the Record Preferences settings.

  7. Click OK.

14.2.2 Setting Image Based Recording Functional Test Playback Preferences

To set Image Based Recording Functional Test record preferences:

  1. Start OpenScript.

  2. Open or record an Image Based Recording script.

  3. Select OpenScript Preferences from the View menu.

  4. Expand the OpenScript node and the Playback category.

  5. Select Image Based Recording.

  6. Click the tab and set the preferences. See Section 2.4.5, "Image Based Recording Playback Preferences" for descriptions of the Record Preferences settings.

  7. Click OK.

14.3 Creating an Image Action

To create an image action using the menu:

  1. Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.

  2. Select Add from the Script menu, and then select Other.

  3. Expand the Image Actions category.

  4. Expand the Image Target group.

  5. Select the type of image action to perform and click OK.

  6. Specify a step title for the image action.

  7. Click Capture to start the capture mode. The OpenScript window is minimized and the cursor changes to a crosshair.

  8. Click the left mouse button and drag the crosshair cursor around the area of the screen to capture. A red bounding box appears to identify the area. Right-click to cancel the current capture area to start over. Press Escape to cancel the current capture.

  9. Double-click the left mouse button inside the bounding box to capture the image and set the X/Y offset point.

  10. Verify the OffsetX and OffsetY values to make sure the crosshair location is correct within the captured image.

  11. Click Threshold Test to verify the Threshold of Similarity setting.

  12. Review the screen capture in the Threshold Test window to verify the correct location on the screen is identified with a red bounding box.

  13. Close the threshold Test window and if necessary, adjust the Threshold of Similarity setting, and repeat the test.

  14. Click OK when done. The image action is added to the script tree.

To create an image action using the toolbar:

  1. Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.

  2. Click the Record Image Action toolbar button.

  3. Select the type of image action to perform.

  4. Press F10 to start the capture mode.

  5. Follow the steps above starting with step 8.

14.4 Creating an Image Test

To create an image action using the menu:

  1. Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.

  2. Select Add from the Script menu, and then select Other.

  3. Expand the Image Tests category.

  4. Select VerifyExistence and click OK.

  5. Specify a step title for the image action.

  6. Click Capture to start the capture mode. The OpenScript window is minimized and the cursor changes to a crosshair.

  7. Click the left mouse button and drag the crosshair cursor around the area of the screen to capture. A red bounding box appears to identify the area. Right-click to cancel the current capture area to start over. Press Escape to cancel the current capture.

  8. Double-click the left mouse button inside the bounding box to capture the image and set the X/Y offset point.

  9. Verify the OffsetX and OffsetY values to make sure the crosshair location is correct within the captured image.

  10. Click Threshold Test to verify the Threshold of Similarity setting.

  11. Review the screen capture in the Threshold Test window to verify the correct location on the screen is identified with a red bounding box.

  12. Close the threshold Test window and if necessary, adjust the Threshold of Similarity setting, and repeat the test.

  13. Click OK when done. The image test is added to the script tree.

To create an image test using the toolbar:

  1. Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.

  2. Click the Record Image Test toolbar button.

  3. Select the type of image action to perform.

  4. Press F10 to start the capture mode.

  5. Follow the steps above starting with step 8.

14.5 Enabling Image Based Recording for Another Functional Test Module

The Image Based Recording module can be used with other Functional Test modules by enabling Image Based Recording within the Functioanl Test script.

To enable Image Based Recording for another Functional Test module:

  1. Create a Functional Test script.

  2. Select Script Propereties from the Script menu.

  3. Select the Modules category.

  4. Select Image Base Recording and click OK.

    The Record Image Action and Record Image Test toolbar buttons appear on the toolbar.

14.6 Playing Back Scripts

OpenScript plays back recorded Image Based Recording actions/tests which consist of captured images identified by attributes. The actions used for playback will either be those that are recorded or specified manually in the Java Code view.

The Image Based Recording Functional Test Module uses the OpenScript playback and iterate toolbar buttons which allows users to start the script playback for either a single playback through the script or multiple iterations using data from a databank file. Playback results for Oracle JET functional test scripts can be viewed in the Results and Console views.

14.6.1 Playing Back Image Based Recording Functional Scripts

To play back Image Based Recording Functional scripts:

  1. Start OpenScript.

  2. Open the Image Based Recording Functional Test script to play back.

  3. Select Playback from the Script menu or click the toolbar button.

    You can view the progress of the script playback in the Console View. You can review the results of script playback in the Results View.

14.6.2 Playing Back Image Based Recroding Functional Scripts with Iterations

To play back Image Based Recording functional test scripts with iterations:

  1. Start OpenScript.

  2. Open the Oracle JET functional test script to play back.

  3. Select Iterate from the Script menu or click the toolbar button.

  4. Select Use Databanks.

  5. Select which databank file to specify the settings for if more than one database is configured for the script.

  6. Specify the settings for the databank file.

  7. Select the Run no more than [ ] iterations option and set the iteration count to the desired number of playback iterations. See Section 4.2.4, "Playing Back Scripts With Iterations" for additional information about iteration settings.

  8. Click OK.

    You can view the progress of the script playback in the Console View. You can review the results of script playback in the Results View.