OnStartTest and OnStopTest is not working properly.
I only want to call this function when TC starts and stops not on every script run.
I have script A, B, C, D
If I execute just B then start and stop works fine
But If I execute A, B, C, D then Start and stop call on each script. in other words Before and after A, then before and after B etc. I only want to call Start when testcomplete starts and call Stop when test complete closes.
This behavior is correct. OnStartTest and OnStopTest are fired for each test item. Currently, you can check the current test item's name (Project.TestItems.Current.Name) in event handlers to check whether this test item is the first or last one in your test to avoid executing OnStartTest and OnStopTest for all test items.
We have a suggestion to implement the OnStart and OnStop events for the entire project suite, and your request has increased its rating.