Insert a Java code snippet
You can insert a Java code snippet to perform additional operations that are not supported by the simplified scripts. The Java code snippet runs during script playback.
Before you beginPrerequisite: Knowledge of Java programming
To insert a Java code snippet:
- Select the test line in the simplified script editor. Right-click and select Insert Java Code Snippet (). This line is inserted after the selected test line: Click here to tag the Java snippet
- To easily identify the Java code in the Java editor, select the inserted test line and replace the test line text by typing a tag for the Java code.
- Click File > Save to save the simplified script.
- Click Java editor that is displayed next to the Script editor. The inserted Java tag is displayed as a comment with the start and the end point for inserting the Java code in the Java editor.
- Type the Java code within the start and the end comment section.
- Click File > Save to save the Java script. During the script playback, the inserted Java code also runs.
Do not edit the Java code outside the start and the end points that are inserted when you use the Insert the Java code snippet feature in the simplified script editor. All the changes to the Java script are lost if you later edit the simplified script.