I think the reason you are currently getting the null error for aqTestCase.CurrentTestCase is that you are running the test cases at the test level with the associated event handler. I think you've also noticed the behavior that the null error does not occur when you run it at the project level with the desired test cases. This happens because the event handler kicks in after the test case (at least for certain event handlers) which means that there are no test cases, hence no aqTestCase (hence null).
But in terms of "calling the same handler for every test", this will still stand, because event handlers are created precisely for that reason (so that the same thing occurs EVERY time you run the test). The updated event handlers (OnTestCaseStart/OnTestCaseEnd event) will have additional properties (namely
parameters:
-
Test case status (passed/warning/failed)
-
The first error object with properties:
-
Message
-
Additional message
-
Picture (if "screenshot on error" option is enabled) that we should be able to incorporate into our event handlers as needed. In terms of selective set up/teardown methods, I'd look into create short keyword tests or scripts to meet that need. I'd love to have more conversations with you to understand the your use case, and see if I can have more discussions with our product owner 🙂
-
Related Content
- 12 years ago
- 12 years ago
- 11 years ago