Forum Discussion

ameett's avatar
ameett
Contributor
13 years ago

Exception handling and Overnight run

Hello,

Following is the case -

Script unit1 has following three tests

function demo1()

{

  some code......

}



function demo2()

{

  some code......

}



function demo3()

{

  some code......

}



Now script unit2 has following test

function demo()

{

  demo1()

  delay(1000)

  demo2()

  delay(1000)

  demo3()

}



Script unit3 has following test

function demoMain()

{

  demo()

}



I am executing "demoMain".....in turn it executes "demo"..............which finally executes all the tests from script unit1..."demo1", "demo2", "demo3"

Now suppose that while executing test "demo1" some error ocurs...say an Unexpected Window appears...I have to close this window, end the execution of test "demo1" and then continue the execution of tests "demo2" and "demo3".

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Since it looks like you're using JScript, I would recommend using try/catch/finally logic to capture those errors and "clean up" the functions so that you can move on to the next test.