This chapter provides an overview of script creation and discusses how to:
Capture and import test results.
Edit virtual scripts.
Understanding Script Creation
You use Oracle's JD Edwards EnterpriseOne Virtual Autopilot to create a script that accurately simulates the activities of multiple simultaneous users of the JD Edwards EnterpriseOne software. To write a script, you use two key components of JD Edwards EnterpriseOne automated testing tools architecture:
JD Edwards Autopilot
Virtual Autopilot Script Editor
Using these two tools, you accomplish this sequence of tasks to create a virtual script:
Create a JD Edwards Autopilot script.
Run the JD Edwards Autopilot script with playback configured so that you can capture system and JD Edwards Autopilot data.
Import the event stream into the Virtual Autopilot Script Editor.
Create value links between source parameters of API calls and the target parameters of other API calls to ensure that usable data flows between API calls when you run the virtual script.
Generate the JD Edwards Virtual Autopilot script, which the Virtual Script Player runs.
After you create a virtual script, the Virtual Script Player can run the script.
Capturing and Importing Test Results
This section provides an overview of test results and discusses how to:
Capture test results.
Import test results.
View test results.

Understanding Test Results
JD Edwards Autopilot enables you to create scripts that test JD Edwards EnterpriseOne software applications. When you create a script, you can configure JD Edwards Autopilot's playback function so that it captures and saves the results of the playback session, which it stores in the Autopilot Playback Results Detail Table (F97214) as an event stream.
You can view the playback results in a variety of ways. You can view the event stream alone, you can view details of individual events, or you can view timing information about groups of events and thread identifiers, displayed in a horizontal bar graph.
The data that JD Edwards Autopilot captures provides the raw material for the JD Edwards Virtual Autopilot script. After you capture JD Edwards Autopilot script data, you import it to the Virtual Autopilot Script Editor so that you can prepare a virtual script.

Capturing Test Results
To gather the raw data for a virtual script, you must first write and run a JD Edwards Autopilot script and capture the results of the playback as an event stream. You use the Tools option in the menu bar of the JD Edwards Autopilot form to configure the capture mechanism.
To capture test results:
From the desktop or the appropriate directory, double-click the JD Edwards Autopilot executable. Create the JD Edwards Autopilot script or open an existing script.
From the File menu, select Open to open a JD Edwards Autopilot script.
Important! When you run the script, it must sign on to a JD Edwards EnterpriseOne software environment. A script that does not include this sign on does not function correctly in JD Edwards Virtual Autopilot because it does not contain the data required for the Virtual Script Player to initialize the environment.
From the Tools menu, select Options.
On the Options form, select the Playback tab.
Select these options:
Save Results Data after Playback
Display Results Data after Playback
This setting is optional.
In the Event Stream Capture Level portion of the Playback tab, select Level 1 API calls.
Note. If you want to capture more script playback events, select the All API call levels option. Remember that you generate a much larger event stream if you select this option.
Click OK.
Save the JD Edwards Autopilot script.
In the JD Edwards Autopilot menu bar, click Play and select Play From Top.
JD Edwards Autopilot runs the script. The Play From Top command generates test results for the machine on which JD Edwards Autopilot is running. The JD Edwards Autopilot Results form displays detailed information about the playback session.
Click File/Exit to close JD Edwards Autopilot.

Importing Test Results
After you have run a JD Edwards Autopilot script and saved the playback results, you can import the event stream into the Virtual Autopilot Script Editor. Importing the event stream enables you to use the Virtual Autopilot Script Editor to forge value links between the source and target parameters of API calls; and to generate a virtual script.
To import playback results into the Virtual Autopilot Script Editor:
From the desktop or the appropriate directory, double-click the Virtual Autopilot Script Editor executable.
On Virtual Autopilot Script Editor, select a script to import.
Click the Import button.
After the Virtual Autopilot Script Editor imports the script, an APEdit dialog box appears, confirming that the import was successful.
In the Virtual Autopilot Script Editor dialog box, click OK.
Important! If you attempt to import an invalid results set, JD Edwards Virtual Autopilot displays a warning issue. For example, if you
start JD Edwards Autopilot after you manually sign on to JD Edwards EnterpriseOne, the results set will be invalid.
If a message appears, you should recapture the data, making sure that you sign on to the system through JD Edwards Autopilot.
To do so, close JD Edwards EnterpriseOne software, and then launch the JD Edwards Autopilot script. JD Edwards Autopilot handles
your system sign on.

Viewing Test Results
After you successfully import the results of a script playback, the event stream appears in the detail area of the Virtual Autopilot Script Editor form.
Important! An exclamation point next to a start time (in the Start column) in a line of the event stream indicates that an error occurred
during data capture.
If you find exclamation points in the event stream, you should investigate the possible causes for the error, and then edit
and rerun the JD Edwards Autopilot script to generate an error-free event stream.
To view the event stream:
From the desktop or the appropriate directory, double-click APEditor.exe, the Virtual Autopilot Script Editor executable.
Import the results set (event stream) that you want to view.
In the toolbar of the Virtual Autopilot Script Editor form, click one of these options:
Details
Graph
Both
To view the event stream alone, click the Details option in the toolbar. To view categories of playback events, thread activity, or both represented in a horizontal bar graph by duration and time of occurrence, click the Graph option, and then click the scroll bar button in the form to select either View Graph by Message Type or View Graph by Thread ID. Click the Both option to view both the linear event stream and the horizontal bar graph representation.
Editing Virtual Scripts
This section provides an overview of virtual script generation and discusses how to:
Use the Find feature.
Value-link parameters.
Link values in inquiry scripts.
Link values in entry scripts.
Generate JD Edwards Virtual Autopilot scripts.
Create master scripts.

Understanding Virtual Script Generation
After you import an event stream into the Virtual Autopilot Script Editor, you create value links and then generate the virtual script. The Virtual Autopilot Script Editor passes value link information, as well as playback information that it stores automatically, to the Virtual Script Player, which runs the virtual script.
When you create value links, you ensure that data necessary to run the virtual script flows dynamically between parameters in API calls. For example, you must value link APIs that use next numbers so that the Virtual Script Player retrieves the appropriate next number during virtual playback. If you fail to value link the next number parameter in this scenario, the Virtual Script Player passes the same value used in the original script to the API parameter that requires it, which causes a duplicate key error. When you forge a value link, the Virtual Autopilot Script Editor stores the parameter value in a variable, which ensures that the value changes each time you run the script, preventing duplicate keys and data contention.
The JD Edwards Virtual Autopilot set also enables you to concatenate virtual scripts into a master script list using the VSMEditor. Using a master script enables you to test more than one script in a single virtual script playback session.

Using the Find Feature
You use the Find feature in the Virtual Autopilot Script Editor to search for parameters that you will need to value link to create the JD Edwards Virtual Autopilot script.
To use the find feature:
Click inside the pane you want to search.
Note. Not all Virtual Autopilot Script Editor panes are searchable.
Type a value in the Find control on the toolbar, or select Find from the Edit menu.
To search for valid value list values to link, enter a list value to the Find control.
To find data dictionary aliases, enter a data dictionary alias, such as AN8.
Check the Case Sensitive button, if desired.
Click Enter to run the search.
The Virtual Autopilot Script Editor finds the first parameter with a data dictionary alias that matches the search criterion and marks it with an arrow.
Note. As you click a button to link or perform another task, you might lose the focus to the pane you were searching. Be sure to reset the focus to the pane you are searching if you want to search again.

Value-Linking Parameters
Value linking enables data to flow from function to function within JD Edwards EnterpriseOne software. For a JD Edwards Virtual Autopilot script to accurately simulate system activities, it must not produce any duplicate key values in the system database. Therefore, for scripts that enter new data to the database or update existing data, at a minimum, you must value link all next number, job number, and batch number parameter values in the Virtual Autopilot Script Editor. You can run simple inquiry scripts without any value linking, but not transactional scripts.
The Virtual Autopilot Script Editor links some values automatically, but you must link others manually.
To run scripts accurately, you should always value link the parameters that:
Pass the name of the machine on which you ran the original JD Edwards Autopilot script.
Reference the date on which the original JD Edwards Autopilot script ran.
Pass Next Numbers or serialized values (possibly labels of data items DOC, JOBS, MATH06, PYID, ICU).
Use valid value list data. Linking these parameters ensures that the Virtual Script Player will use the .atd directory, where you store valid values list data as the source from which to retrieve data during virtual script playback.
Note. You can use the Find feature to quickly find functions containing data to be linked. Click the column header to reorder the table (usually by label, value, or ID) to group like information.
To value link parameters:
From the desktop or the appropriate directory, double-click the Virtual Autopilot Script Editor executable.
Import a JD Edwards Autopilot script into the Virtual Autopilot Script Editor.
Click the Link Parameters button in the toolbar.
The Source Parameters pane and Target Parameters pane appear.
In the Target Parameters pane, select a target parameter line item.
The source parameters for that target display in the Source Parameters pane.
Note. Do not select the Show All option in the Source Parameters pane when you are ready to create a link because doing so causes the Virtual Autopilot Script Editor to display events that are not appropriate for linking.
To link a single parameter line item, select it and click the Link button.
To link all items in the script that match the source, target, label, and value parameters, select a representative parameter line item in the source pane and click the Link All button.
Note. Some parameters in the Target Parameters pane do not have a value from a source parameter. You can mark these as Literal using the Mark Literal Button. If you do not want to see the parameters that you have marked as Literal, click Link in the menu bar and select Filter Literals.

Linking Values in Inquiry Scripts
Because an inquiry does not change or update any data in the system, you may not have to forge value links between parameters in inquiry scripts. However, you should value link parameters that contain valid values list data to ensure that the data changes during playback of the virtual script.
If the script contains valid values data, you can run the virtual script, change the data, and run it again to extend the stress testing. You can change the data in the list without creating new value links.
To link values in inquiry scripts:
From the desktop or the appropriate directory, double-click the Virtual Autopilot Script Editor executable.
Find valid values list data in the event stream.
Link all source parameters containing valid values list data to the appropriate target parameters.
Document the data dictionary aliases that the Virtual Autopilot Script Editor links.
Note. You find data dictionary aliases in the Label column of the Source Parameters pane and the Target Parameters pane.

Linking Values in Entry Scripts
Because entry scripts change or update system data, you are required to link values in entry scripts before you generate a virtual script. Value linking ensures that Virtual Script Player can pass values between parameters and that key parameter values change during virtual script playback, preventing record duplication.
To link values in entry scripts:
From the desktop or the appropriate directory, double-click the Virtual Autopilot Script Editor executable.
Find and link any parameters that pass the machine name on which the JD Edwards Autopilot script originally ran (these might be marked with CTID or MKEY data dictionary aliases or labels).
Find and link parameters that pass the date that the JD Edwards Autopilot script originally ran.
Find and link parameters that pass Next Numbers or serialized values (possibly data dictionary aliases of DOC, JOBS, MATH06, PYID, and ICU).
Find and link parameters that pass valid values list values.
Document the data dictionary aliases that the Virtual Autopilot Script Editor links.

Generating JD Edwards Virtual Autopilot Scripts
To generate the JD Edwards Virtual Autopilot script:
From the desktop or the appropriate directory, double-click the Virtual Autopilot Script Editor executable.
In the event stream event pane, click the Generate button.
Assign a file name and location to which you want to save the generated script and click OK to begin script generation.
When you click the Generate button, the Virtual Autopilot Script Editor produces a virtual script, which the Virtual Script Player uses to simulate playback. A Script Log form appears following generation, summarizing the number of lines in the script and the number of errors, if any. You should generate an error-free script before you attempt to run it.
After JD Edwards Virtual Autopilot generates the script, the Virtual Player Script Log form appears and displays information about the script generation, including the status (complete or incomplete), the number of lines, and the number of errors. If the Script Log form indicates that errors occurred during generation, you must investigate the error summaries that appear in the form, correct them, and then repeat the steps for creating a virtual script.
Click OK to close the Virtual Player Script Log form.
Note. After you generate a virtual script, it is static. Any script changes that you make in JD Edwards Autopilot require re-editing and regeneration in JD Edwards Virtual Autopilot. Thus, careful documentation of the editing process is critical to the production of repeatable results. The easiest way to document the editing process is to save your editing session. You can do this by selecting Save As from the File menu, which creates a .apv file. This file is a record of the editing session; it is not a virtual script.

Creating Master Scripts
Using the VSMEditor tool, you can concatenate JD Edwards Virtual Autopilot scripts into a single master script. Concatenation gives you another testing option: you can run test series of scripts within a single playback session.
To create a master script:
From the desktop or the appropriate directory, double-click the VSMEditor executable.
In the All Virtual Scripts list box, select the script files that you want to include in the master script.
When you have chosen all the virtual script text files that you want, click the Add button.
VSMEditor adds the script files to the Master Script list box.
Manipulate the list in the Master Script list box by using the buttons adjacent to the box to remove script files or to change their order.
When you have decided on the content and order of the master script, click the Save Master Script button.
The VSMEditor saves the master script as a .vsm file. The file includes:
Master script version
Checksum value to verify file integrity
RandomStart parameter (a value of 1 means that the first script to run is chosen randomly)
List of JD Edwards Virtual Autopilot Script files