Skip to main content

Automating the System Test

Example: Examples.CounterTest

Tip

You can find the CODESYS sample projects Bspdt-TestManager and CounterTest in the C:\ProgramData\CODESYS Test Manager directory.

In a test script, you program the flow of test cases. A test case consists of test actions which are provided by test drivers. They cover many functionalities of CODESYS. You configure the test actions in the test element editor, without the need for special programming skills. Moreover, you can call IEC or IronPython scripts. When calling an IronPython script within a test script, the CODESYS scripting interface is used. Scripts can complete tasks which are not covered by the existing test drivers. For example, this is helpful for completing recurring routine tasks or for extending the functionality of the CODESYS Test Manager.

When the test is executed, a test case is counts as passed when all of its test actions are executed without errors. You can configure the error handling for each test case and its test actions.

As a whole, this kind of simple test script is well-suited for performing a system test, although you do not have access to the interfaces of a testee by means of test driver actions.

Procedure. Creating an automatic system test
  1. Create a test project in CODESYS.

  2. Create a test repository in the Test Manager.

  3. Create a test script and program the test flow in the test script with test cases and test actions.

    Note: Align the test project and test script. For example, the DeleteObjects test driver action needs an object from the project.

    You have automated a system test. Execute the test as often as you want.