Organize a complex script into multiple scripts; then, save scripts together in a
collection of scripts.
About this task
If you create a complex script, you can organize that script into simple scripts that represent
different business or user processes on your web application. Save the scripts together as a test
suite. You can then use these scripts to monitor the performance and availability of your web
application in response to specific user actions in the Application Performance Dashboard.
Important: It is good practice to organize complex scripts into separate scripts, where
each script represents a typical user or business process that you want to monitor. For example,
create separate scripts that record when a user logs in to a website, or searches for an item. If
you organize your scripts according to user or business processes, you can then monitor the response
of your web application to these specific processes in the Application Performance Dashboard.
Procedure
To organize your complex script into separate scripts, and save your scripts as a test
suite, complete the following steps:
- To create a separate script for each user process that is recorded in your script, click in Selenium-IDE. Give each script a meaningful name that describes the user process
and save each script as a .html file, such as
load_homepage.html. For more information, see Recording synthetic scripts.
Important: The name that you give to your script in Selenium-IDE is the name that
identifies the recorded business or user process that you monitor in the Application Performance Dashboard.
- In Selenium-IDE, open a complex script that you recorded previously. Organize your script
commands into separate scripts, according to different user actions. Cut
commands from the original complex script in the Test Case window, and
Paste commands into the different scripts. Save each script again.
For example, the complex script in Recording synthetic
scripts contains Selenium-IDE commands for three different user processes.
- Open the Performance Management home page on the
IBM® Marketplace website.
- Open the Details page on IBM Marketplace.
- Open the View demo page.
The user actions are then organized into three different scripts.
Table 1. Sample script for opening the IBM Marketplace page
(load_homepage.html)| Command |
Target |
Value |
| open |
/ |
|
| verifyTitle |
IBM Performance Management - United States |
|
Table 2. Sample script for opening the Details page on IBM Marketplace(load_products.html)| Command |
Target |
Value |
| clickAndWait |
//div[@id='product-header']/div/div/div/ul/li/ul/li[2]/a/span |
|
Table 3. Sample script for opening the View demo page on IBM Marketplace (load_APM.html)| Command |
Target |
Value |
| clickAndWait |
link=View demo |
|
| assertText |
id=btn_submitform |
Yes, I’d like to watch the demo. |
| assertText |
link=IBM's Privacy statement |
IBM's Privacy statement |
- To save your individual script files together in a test suite, click . Save the test suite as a .html file. Finally, compress the test
suite and individual scripts files together in a .zip file. The .zip file must contain the test suite and any script files that are
included in the test suite.
Results
You recorded a set of scripts that you can use to monitor the performance and availability
of your web applications. Use the Synthetic Script Manager to upload your
.zip
file of scripts to a new or existing synthetic transaction.
For more
information, see Creating and editing a synthetic transaction.