Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Reporting test case failure in test manager

mazahar
2014-02-10
2014-02-10
  • mazahar - 2014-02-10

    Hi,
    I am using the test manager for executing my automated tests. But for some of the steps that i do as part of the test like setting up the device/upgrade device software, i would like to report a test case failure if the step is not successful. I could not find a way to report the failure using the commands from test action. I am currently managing it to get the failure reported by including an undefined script variable in the input parameters section of test action.

    Many Thanks,
    Mazahar

     
  • mkeller - 2014-02-10

    Hi mazahar.

    I'm a bit confused. The normal behaviour for a failed test action is to abort the test case. The subsequent test actions are skipped. The exception is if you activate the option "Ignore failure" or use the "Expected Exceptions" of the extended settings.

    Using an undefined test script variable will always trigger an error if the test action is executed.

    Regards,
    Martin

     
  • mazahar - 2014-02-10

    Hi Martin,
    Thank you for the response.

    The scenario i am having is a test script with multiple test cases and multiple test actions in each test case. For example, i want to proceed with executing my actual tests only if the device is online. so, i would first ping the device (using python script) and continue executing tests if the device is online. If it isn't online, i would like to report the error with a test case failure and save time rather than proceed further with executing all the tests.

    regards,
    /mazahar

     
  • mkeller - 2014-02-10

    Hi.

    Possible solutions:
    - Write the result of your check to an previously defined test script variable and use the test element Choose to check this variable
    - Thrown an .Net exception inside the python script which causes the test action to fail and so the test case is aborted
    - Combine the previous solution with the option "Cancel test run on failure" to abort the test run

    Regards,
    Martin

     

Log in to post a comment.