Forum Discussion

LRuoc's avatar
LRuoc
Contributor
4 years ago

Unexpected behaviou handling

Hello All,


Thank you for taking the time to read my thread.

I am new to Automation testing and TestComplete but am experienced with using similar tools, so apologise if my question is simple.

 

I am currently keyword scripting against desktop applications. I am wanted to make sure they are as robust as possible and handle unexpected behaviour. For example, Im scripting against MS Work currently and producing a script that checks the settings. If a setting isn't as expected, Id like it to recover, log it and then try the next action. I understand that I can use continue on error, but that wouldn't escape from the place I was to be able to try the next test.

 

My questions therefore is, how do I incorporate this into a script? I was thinking of developing another script under a Do While statement and calling all the scripts into it, then under an exception, call a recovering script to clean and tidy up.

Does anyone know any better ideas and recommend the best way for me?

 

Many Thanks

 

 

  • 1. For any unexpected window - you can use the Events of Unexpected window and write the respective cleaning function in it.

    2. Runner.Stop(true) : you can make use of this function whenever you feel your settings are matching with the expected and wanted to stop the testcase there.

     

    • anupamchampati's avatar
      anupamchampati
      Frequent Contributor

      1. For any unexpected window - you can use the Events of Unexpected window and write the respective cleaning function in it.

      2. Runner.Stop(true) : you can make use of this function whenever you feel your settings are matching with the expected and wanted to stop the testcase there.

       

      • sonya_m's avatar
        sonya_m
        SmartBear Alumni (Retired)

        Thanks a lot anupamchampati !

        LRuoc , does this help?