Forum Discussion

AttilaBalazs's avatar
AttilaBalazs
Occasional Contributor
9 years ago
Solved

Running the GeneralEvents_OnStopTest event

Hi all,

I would like to run the OnStopTest and the OnStartTest event in the following situations:

 

1. When an error occurs.

2. At the endo of the test suite/start of a test suit.

3. At the end of an individual test run/start of an individual test run.

I am using scripts not keyword tests.

I am Using JScript. So if you could give your suggestions in JScript or in pseudocode would be a plus.

Looking forward for your ideas.

Thanks in advance for your time.

Atti.

  • Events are triggered automatically when some conditions are met. For Eg : OnLogerror, OnUnexpectedwindow etc. They are used to manage things that happens dynamically during runtime. For example if we need to do something specific when a error is logged. We don't know when this is going to happen. When ever an error is logged from any part of the project suite this even will be triggered.

    2. At the endo of the test suite/start of a test suit. : We exactly does know when this is going to happen and we candefined a method that can perform the actions to be done and just call those at the Start/End of test suite. Hope this helps

    3. At the end of an individual test run/start of an individual test run.  We exactly does know when this is going to happen and we candefined a method that can perform the actions to be done and just call those at the Start/End of test suite. Hope this helps

2 Replies

  • Events are triggered automatically when some conditions are met. For Eg : OnLogerror, OnUnexpectedwindow etc. They are used to manage things that happens dynamically during runtime. For example if we need to do something specific when a error is logged. We don't know when this is going to happen. When ever an error is logged from any part of the project suite this even will be triggered.

    2. At the endo of the test suite/start of a test suit. : We exactly does know when this is going to happen and we candefined a method that can perform the actions to be done and just call those at the Start/End of test suite. Hope this helps

    3. At the end of an individual test run/start of an individual test run.  We exactly does know when this is going to happen and we candefined a method that can perform the actions to be done and just call those at the Start/End of test suite. Hope this helps

  • cunderw's avatar
    cunderw
    Community Hero

    1. There is an on error eveny that you could use to call the function you need.

    2. You can manually add those to your project items, or if you can figure out how many enabled test items you have and how many have rann and run the function when all have ran.

    3. This is what it does anyway.