Recording a Java test script

Java scripts are generated when you work with the simplified scripts. You can switch to Java scripting using the Insert Java snippet and Insert Java module features in the simplified script editor.


Before you begin

Advanced users can opt to work solely with Java scripting. Use the recording feature of IBM IBM Rational Functional Testerto record actions on the test applications. The actions on the test applications are generated in the form of a Java test script when you stop recording.

Prerequisites:

To record a Java test script:

Note: All functional testing scripts use a default helper superclass. You can create your own helper superclass if you want to add additional methods or override the methods in RationalTestScript. For more information, see Change the Default Script Helper Superclass.

To record a script:


Procedure

  1. Click Record a Functional Test Script().

  2. In the Record a Functional Test Script dialog box, select the project for the script to be a part of, and then type a name for the script.

    Script names cannot contain spaces or the following characters: $ \ / : & * ? " < > | # % -

  3. Optional: Select Add the script to Source Control to place the script to be under source control. The script is added to ClearCase® but remains checked out so that you can modify it.

  4. Click Next.

  5. Optional: In the Select Script Assets page, modify the test object map and test datapool if you do not want to use the default settings.

  6. Click Finish to start recording. The Recording Monitor opens and the recording starts.

  7. In the Recording Monitor toolbar, click to start your test application.

  8. Perform test actions in the application.

  9. Optional: You can record verification points or data-drive your test script using the tools available in the Recording Monitor toolbar while recording the script.

  10. Optional: To insert statements to call another script, specify log information, timer or comments during recording, use the Insert Script Support Commands feature available in the Recording Monitor toolbar.

  11. Close your application, if you want closing the application to be part of the script.

  12. Click Stop recording () when you finish recording. A Java test script is generated and displayed in the Java editor.

Related tasks

Associating functional test scripts with the keywords

Data-driven functional tests

Related reference

Tips for recording functional tests

+

Search Tips   |   Advanced Search