Inserting One Script Within Another

In this section of the lesson, you will learn how to insert the second script, which adds a user account, in the original script before the code that perform the request for an auto quote.

Executing scripts within scripts is a powerful method for efficiently testing the same basic actions in scripts.

Tip: When inserting a script within another script, it is important to ensure that any test applications are in the correct initial playback state.
  1. Choose File > Open. The Asset Browser opens.
  2. Select .NET Script in the left pane to display the list of scripts.
  3. From the list, double-click AutoQuote to open it. AutoQuote is the first test that you created in this tutorial.
  4. In the Code window, position the cursor after the Public Sub Main() code, press Enter to add a new line, and type:
    Workbench.RunScript ("AddAccount") 

    where AddAccount is the name of the second script that you created.

    Because we want to add the account information before we execute the quote steps, we added the Workbench.RunScript command before the With statement. To execute the AddAccount script after the quote steps, add the Workbench.RunScript command after the End With statement.