Advertisement

The custom test is made of two different modes : Monitoring-only, or the real custom test.

The Monitoring-only Test

This test won't do anything. It will start, and stop, according to the schedule you specified. All it will do is record the readings until you stop it, or the schedule comes to an end.

The Custom Test

If the monitoring-only checkbox is disabled, you will have access to the main options of the custom test : starting your own application. It may look scary, it is not !

The main goal here is to give OCCT information about your test : How to start it, How to close it, and how to check its status.
  • Start Batch/Exe : the path to the .exe file, or to the batch file, or any executable you want to start. This is usually pointing to your application .exe.
  • Stop Batch/Exe : this is usually pointing to a batch. When executed, it will stop your application automatically. Usually, it points to a batch that kills your application process, as this is the most common way of stopping an application automatically
  • Status Batch/Exe :it is completely optional. This is usually a batch file, that will return 0 if the application is running correctly, or any other value if something is wrong. This is used by OCCT to detect if there's an error.

The "Silent" Checboxes are here t hide the window created by executing the exe you supplied. As a rule of thumb, do not hide the main test window if you want to check its output, and hides the batch files to get rid of the cmd box !

If you check the "Stop on error", OCCT will stop once an error has been reported by the "Status batch/Exe". If you do not check this box, OCCT will continue running until the end of the test has been reached.

Example : a custom test made out of Windows Calc !

1 - Start Batch/Exe : make it point to C:\Windows\System32\calc.exe .
Calc is the application we want to start here. Do not check the silent checkbox, the idea here is to use calc while the test is running.


2 - Stop Batch/Exe : create a StopCalc.bat batch file in C:\ (for instance), and use the following contents :
@echo off
taskkill /IM calc.exe
exit 0

This batch, once run, will kill all processes named "calc.exe". Thus, this will stop our test. Exactly what we want. You can check the "silent" box to hide the cmd window executing the batch.


3 - Status Batch/Exe : create a file named "Statuscalc.bat" in C:\, and use the following contents :
@echo off
tasklist /FI "IMAGEAME eq calc.exe" 2>NUL |find /I /N "calc.exe">NUL
if %ERRORLEVEL%==1 exit 1
exit 0

This will list all processes running, and search for one named "calc.exe". If it is not found ( ERRORLEVEL will be 1), we can exit with the code 1. Otherwise, we quit with the code 0, meaning the test is running. It is highly recommended to check the "silent" checkbox here, unless you want to see a cmd.exe window popping up every second !

Finally, start the test : calc will open, you can do addition, and once you close it, OCCT will detect it has been closed and the test has been ended.