Hello,
I'd like to programmatically check and uncheck scripts in my test suite depending on whether the script passes and fails so that I can run a fail suite automatically at the end of a run (not just re-running a failed script). Is this possible in version 9.0.1?
Thanks in advance for any help.
Programatically checking and unchecking scripts in a test suite.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Programatically checking and unchecking scripts in a test suite.
Hi Ian,
This is possible, but I am not sure if it is the best approach to this scenario. As a best practice, your test cases and suite should utilize [TEARDOWN] regions to clean up the AUT and environment for the next run. The [TEARDOWN] regions will always run, even if there is an error in the middle of the test.
If you wish to continue on your current path, you can dynamically set a test containers checked state in code. This allows you to change the test suites flow during runtime. Note, this must be called before the test container is started.
Also, you may be able to take advantage of Run Configurations (create a run config for your custom teardown). You can easily set the desired run configuration at runtime via the /rc command line argument.
I hope this helps!
Regards,
Ned
This is possible, but I am not sure if it is the best approach to this scenario. As a best practice, your test cases and suite should utilize [TEARDOWN] regions to clean up the AUT and environment for the next run. The [TEARDOWN] regions will always run, even if there is an error in the middle of the test.
If you wish to continue on your current path, you can dynamically set a test containers checked state in code. This allows you to change the test suites flow during runtime. Note, this must be called before the test container is started.
Code: Select all
TestSuite.Current.GetTestContainer("NameOfTestContainer").Checked = true;
I hope this helps!
Regards,
Ned