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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
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
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