title: will QTP be able to exit the current test script and run the next test script (through the master driver script) in case of multi-tier architecture?
body: <p>Below is the design of our 3 tier QTP framework. My question is </p>
  
  <ol>
  <li>will QTP be able to exit the current test script and run the next test script (through the master driver script) if an error occurs in Tier2 or Tier3?</li>
  <li>Is the there any problem with code for the master script which i have written below. The master scripts executes the individual test script and writes the result status, start time and end time into a dictionary which in turn is written back to an excel sheet </li>
  <li>Do you guys see any other limitation/improvement of this design?
  Please Help!</li>
  </ol>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>Master Driver Script – Tier1
  
  Function Master ()
   ‘Take the contents of the excel sheet which stores the path of the test scrip        to be executed, status, start time and end time in a record set
       Do While Not oRecSet.EOF
     dicResultSet.Add rCnt, CreateObject (“Scripting.Dictionary”)
     For Each oField In oRecSet.Fields
      dicResultSet (rCnt).Add oField.Name, oField.Value
      ‘Execute individual scripts
      If oField.Name = “Path” Then
       msQTPapp.Open oField.Value, True
                                          Set qtTestScript = msQTPapp.Test
                                          qtTestScript.Settings.Run.OnError = "NextStep"
                                          strStartTime = Now
                                          qtTestScript.Run
                                          qtTestScript.Close
                                          strEndTime = Now
      End If
      ‘Write the status of the last run script in the dictionary object
      If oField.Name = “Status” Then
                      dicResultSet (rCnt).Item (“Status”)=_                 qtTestScript.LastRunResults.Status
      End If
      ‘Write the start time of the last run script in the dictionary     object
      If oField.Name = “StartTime” Then
                      icResultSet (rCnt).Item (“StartTime”) = strStartTime
      End If
      ‘Write the end time of the last run script in the dictionary object
      If oField.Name = “EndTime” Then
                      dicResultSet (rCnt).Item (“EndTime”) = strEndTime
                      qtTestScript = Nothing
      End If
     Next
     oRecSet.MoveNext
     rCnt= rCnt+1
    Loop
          'Write the status, start time and end time of the individual test scripts in an excel sheet 
          'Close the rec set and connection
  End Function 
  
  Test Script: Action – Tier2
  
  ‘Associate the individual test script with Environmental files, OR and other function library
  Function Test1 ()
   ‘Call L1 from Function lib
   ‘Call L2 from Function lib
  End Function
  
  Function Library– Tier3
  
  Function L1()
   ‘Actual task is getting done here
  End Function
  .
  .
  Function Ln()
   ‘Actual task is getting done here
  End Function</code></pre>
  </div>
  </div>
  </p>