Extracting Errors from the LoadRunner Database

This entry appears in the Mercury Interactive Knowledge Base as entry 5012. It was posted by me on 11/30/03.

Description

It is easy to view the number and type of errors as they occur during your test from LoadRunner Controller. It is difficult to determine error information with the same level of detail after the test unless the errors are exported to a file before the Controller is closed.

Solution

All errors are written to a Microsoft Access file in the results directory (output.mdb). Knowledge Base article #4164 provides an executable that extracts this information in the same format as the LoadRunner 7.2 Controller; and article #4840 shows how to extract all errors types at once with a SQL statement in Access. This article provides SQL statements to recreate all the error views provided by the LoadRunner Controller. It should be useful to people who want detailed error information, who do not want to run an untrusted executable on client machines, and who want the ability to easily modify their queries.

Attachment

extracting_errors_from_the_loadrunner_database.doc

It is easy to view the number and type of errors as they occur during your test from LoadRunner Controller. It is difficult to determine error information with the same level of detail after the test unless the errors are exported to a file before the Controller is closed.

All errors are written to a Microsoft Access file in the results directory (output.mdb). Knowledge Base article #4164 provides an executable that extracts this information in the same format as the LoadRunner 7.2 Controller; and article #4840 shows how to extract all errors types at once with a SQL statement in Access. This article provides SQL statements to recreate all the error views provided by the LoadRunner Controller. It should be useful to people who want detailed error information, who do not want to run an untrusted executable on client machines, and who want the ability to easily modify their queries.

LoadRunner 7.8 includes some queries in output.mdb, but they have no description and do not provide the same views as the Output window in LoadRunner Controller.

To re-create the Output window with error counts for all error types, use:

SELECT
 ErrorSummary.Type,
 ErrorSummary.Error_Code,
 ErrorSummary.Error_Template,
 ErrorSummary.Total_Messages,
 ErrorSummary.[#Vusers],
 ErrorSummary.[#Scripts],
 ErrorSummary.[#Generators]
FROM
 ErrorSummary
WHERE
  ErrorSummary.Type=2;

User-defined output and debug messages are also written to the database. To restrict the query to errors only, disregard entries with Type not equal to 2.
To re-create the Output window for a specific error type, use:

SELECT
 ErrorMessages.Message_String,
 Scripts.Script_Name,
 Actions.Action_Name,
 Main.Line, Main.Time,
 Main.Iteration,
 VusersID.Vuser_ID_Name,
 Injectors.Injector_Name
FROM
 ((((Main
 INNER JOIN
  ErrorMessages
 ON
  Main.Message_ID = ErrorMessages.Message_ID)
 INNER JOIN
  Scripts
 ON
  Main.Script_ID = Scripts.Script_ID)
 INNER JOIN
  Actions
 ON
  Main.Action_ID = Actions.Action_ID)
 INNER JOIN
  VusersID
 ON
  Main.Vuser_ID = VusersID.Vuser_ID)
 INNER JOIN
  Injectors
 ON Main.Injector_ID = Injectors.Injector_ID
WHERE
 Main.Type=2
 AND
 Main.Error_Code=-17999
ORDER BY
 Main.Time;

The Error_Code value should be changed to the code for the desired error.
Note that this is similar to the pre-defined query QmainErrList in the Access database.

In general, when exporting a particular type of error, the most important fields to extract are Message, Time and Vuser. Modify these SQL scripts as needed.

Leave a Reply