TestOptimal Wiki

Model-Based Testing (MBT)

User Tools

Site Tools


how_do_i_tell_testoptimal_to_take_a_screen_snapshot_when_it_errored

Taking Screenshot on Failures

You can have TestOptimal take a screen snapshot when MBT execution encounters errors or failures.

The difference between errors and failures are that the errors are the result of runtime programming error or system error which typically would cause the model execution to abort.

Failures are typically the result of finding a defect when the condition specified for <assert> tag evaluates to false.

The following example mScript codes will instruct TestOptimal to take a screen snapshot when there is an error or failure:

<mbt>
  <script type="onException">
     <action code="$snapScreen()"/>
  </script>
  <script type="onError">
     <action code="$snapScreen()"/>
  </script>
</mbt>

Clean Up SnapScreen Files

Screenshots are stored in snapscreen folder in each model folder. The snapshot files will accumulate over time and need to be cleaned up. There are 3 ways to clean up these files:

  • delete them directly from the OS folder
  • delete them through “ScreenShots” tab
  • configure TestOptimal to automatically purged them each time the model is executed
how_do_i_tell_testoptimal_to_take_a_screen_snapshot_when_it_errored.txt · Last modified: 2016/09/22 02:35 (external edit)