Forum Discussion
aagapov
14 years agoOccasional Contributor
Alex,
well, the idea is fairly easy, there is a main script which manages other ones; it can launch them according the some input list file but need to have a possibility to interrupt the particular function execution in case of error (only one particular function!) and continue testing with the rest.
Just for instance, Runner.Stop() function stops execution at all.
For example we have main script like as follows:
MainUnit.sj
function Main() {
try {
while(/*read .lst file*/) {
try {
executeTestFunction("testUnit.test1");
}
catch (ex) {
/// do something
}
finally {
/// clean up
}
}
}
catch (e) {
Log.Message("catch - " + e.description);
}
}
function EventControl1_OnLogError(Sender, LogParams)
{
Log.Message("Error desciption");
throw "TSException";
}
Here is a generic test case:
testUnit.sj
test1()
{
try {
.................
Log.Error("Error happened");
.................
}
catch (e) {
throw "TestCaseException";
}
}
I would like to note that such approach worked in the old version of TC at least in version 3.
Thanks for your help.
Regards,
Aleksey.
well, the idea is fairly easy, there is a main script which manages other ones; it can launch them according the some input list file but need to have a possibility to interrupt the particular function execution in case of error (only one particular function!) and continue testing with the rest.
Just for instance, Runner.Stop() function stops execution at all.
For example we have main script like as follows:
MainUnit.sj
function Main() {
try {
while(/*read .lst file*/) {
try {
executeTestFunction("testUnit.test1");
}
catch (ex) {
/// do something
}
finally {
/// clean up
}
}
}
catch (e) {
Log.Message("catch - " + e.description);
}
}
function EventControl1_OnLogError(Sender, LogParams)
{
Log.Message("Error desciption");
throw "TSException";
}
Here is a generic test case:
testUnit.sj
test1()
{
try {
.................
Log.Error("Error happened");
.................
}
catch (e) {
throw "TestCaseException";
}
}
I would like to note that such approach worked in the old version of TC at least in version 3.
Thanks for your help.
Regards,
Aleksey.
Related Content
- 4 years agokiranka
- 9 months agomortenb123
- 13 years agojitendra_1
Recent Discussions
- 2 hours agoSubhraDas
- 8 hours agoJacobjacob44