Creating a Driver Script

Driver scripts facilitate a modular approach to application testing. Instead of creating one script that performs a complete test, you can create reusable scripts to cover individual parts of a whole test flow, then use a driver script to call each part.

  1. Record a new script. For example, this script might start the test application and open a dialog box or window. If you are testing a Web application, the driver script might start the browser and open a specific Web page.
  2. Stop recording when you reach the point at which you want to playback another script.
  3. In the Code window, move the cursor to a new line and type:
    Workbench.RunScript ("script") 

    where script is the name of the script.

    A well-designed script returns the test application to the original test site before completion to ensure that driver scripts can always pick up from where they left off.

    Scripts stored in Oracle databases are case sensitive. Any included script from an Oracle database must match the name in the database exactly or Silk Test Workbench fails to load the script.
  4. If you want to play back scripts at additional test sites in the test application, continue to record steps to drive the test application to the appropriate state. Stop recording and insert another RunScript command.
  5. When you have inserted all the tests that you want to include, record steps to close the test application or to return the test application to a state appropriate for other tests or test suites you may want to run.