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.
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
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.
This section decribes setting Image Based Recording record and playback preferences.
To set Image Based Recording Functional Test record preferences:
Start OpenScript.
Open or record an Image Based Recording script.
Select OpenScript Preferences from the View menu.
Expand the OpenScript node and the Record category.
Select Image Based Recording.
Click the tab and set the preferences. See Section 2.5.4, "Image Based Recording Record Preferences" for descriptions of the Record Preferences settings.
Click OK.
To set Image Based Recording Functional Test record preferences:
Start OpenScript.
Open or record an Image Based Recording script.
Select OpenScript Preferences from the View menu.
Expand the OpenScript node and the Playback category.
Select Image Based Recording.
Click the tab and set the preferences. See Section 2.4.5, "Image Based Recording Playback Preferences" for descriptions of the Record Preferences settings.
Click OK.
To create an image action using the menu:
Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.
Select Add from the Script menu, and then select Other.
Expand the Image Actions category.
Expand the Image Target group.
Select the type of image action to perform and click OK.
Specify a step title for the image action.
Click Capture to start the capture mode. The OpenScript window is minimized and the cursor changes to a crosshair.
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.
Double-click the left mouse button inside the bounding box to capture the image and set the X/Y offset point.
Verify the OffsetX and OffsetY values to make sure the crosshair location is correct within the captured image.
Click Threshold Test to verify the Threshold of Similarity setting.
Review the screen capture in the Threshold Test window to verify the correct location on the screen is identified with a red bounding box.
Close the threshold Test window and if necessary, adjust the Threshold of Similarity setting, and repeat the test.
Click OK when done. The image action is added to the script tree.
To create an image action using the toolbar:
Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.
Click the Record Image Action toolbar button.
Select the type of image action to perform.
Press F10 to start the capture mode.
Follow the steps above starting with step 8.
To create an image action using the menu:
Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.
Select Add from the Script menu, and then select Other.
Expand the Image Tests category.
Select VerifyExistence and click OK.
Specify a step title for the image action.
Click Capture to start the capture mode. The OpenScript window is minimized and the cursor changes to a crosshair.
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.
Double-click the left mouse button inside the bounding box to capture the image and set the X/Y offset point.
Verify the OffsetX and OffsetY values to make sure the crosshair location is correct within the captured image.
Click Threshold Test to verify the Threshold of Similarity setting.
Review the screen capture in the Threshold Test window to verify the correct location on the screen is identified with a red bounding box.
Close the threshold Test window and if necessary, adjust the Threshold of Similarity setting, and repeat the test.
Click OK when done. The image test is added to the script tree.
To create an image test using the toolbar:
Create an Image Based Recording script or enable the Image Based Recording module in another Functional Test script.
Click the Record Image Test toolbar button.
Select the type of image action to perform.
Press F10 to start the capture mode.
Follow the steps above starting with step 8.
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:
Create a Functional Test script.
Select Script Propereties from the Script menu.
Select the Modules category.
Select Image Base Recording and click OK.
The Record Image Action and Record Image Test toolbar buttons appear on the toolbar.
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.
To play back Image Based Recording Functional scripts:
Start OpenScript.
Open the Image Based Recording Functional Test script to play back.
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.
To play back Image Based Recording functional test scripts with iterations:
Start OpenScript.
Open the Oracle JET functional test script to play back.
Select Iterate from the Script menu or click the toolbar button.
Select Use Databanks.
Select which databank file to specify the settings for if more than one database is configured for the script.
Specify the settings for the databank file.
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.
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.