Programmatically Enable or Disable Database Logging or Report Generation

Updated Sep 27, 2022

Environment

Software

  • TestStand

How can I programmatically enable or disable Database and/or Report Logging in TestStand?

You can programmatically enable or disable Database Logging and/or Report Generation using the DatabaseOptions and ReportOptions Sequence File callbacks. Add the callbacks to your client sequence file and change the disable flags as follows.

Database Logging:
  1. Select Edit»Sequence File Callbacks.
  2. Select the DatabaseOptions Callback and click the Add button to add the callback to your client sequence file.
  3. Click OK to close the Sequence File Callbacks dialog box.
  4. Inside of your client sequence file, open the DatabaseOptions Callback.
  5. Insert a Statement step. Right-click and select Insert Step»Statement.
  6. For the expression, type Parameters.DatabaseOptions.DisableDatabaseLogging = True to disable Database Logging.  Type Parameters.DatabaseOptions.DisableDatabaseLogging = False to enable Database Logging.

Report Generation: 
  1. Select Edit»Sequence File Callbacks.
  2. Select the ReportOptions Callback and click the Add button to add the callback to your client sequence file.
  3. Click OK to close the Sequence File Callbacks dialog box.
  4. Inside of your client sequence file, open the ReportOptions Callback.
  5. Insert a Statement step. Right-click and select Insert Step»Statement.
  6. For the expression, type Parameters.ReportOptions.DisableReportGeneration = True to disable Report Generation.  Type Parameters.ReportOptions.DisableReportGeneration = False to enable Report Generation.

Additional Information

You can also override the ModelPluginOptions and ModelPluginConfiguration callbacks to edit the configuration of the Database Logging or Report Generation Plug-ins, refer to the following document for further details Model Plug in Client-File Callbacks​​​​​ .