Hello community!
I need to get value "test interrupted" or "test completed" when OnStopTest event is triggered.
I try to get it from log message "The test execution was interrupted.", but sometimes message appears after OnStopTest event is ended.
OnLogError event does not triggered after OnStopTest event.
To add mark at the end of each test not conveniently.
Anybody knows another solution?
Solved! Go to Solution.
Sure @BVS ! Thank you for updating us.
Let me post a temporary solution to this thread that our support engineers provided you with.
First, they suggest that you create a feature request for adding the «Interrupted» property to the Log object.
And, here's one more suggestion from them:
>>
Also, here is another idea that you can try: save a log to a text file and write a custom script to find the needed "The test execution was interrupted" string in the whole log. Here is the article where you can find more information about the Log object: https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/index.html.
<<
Edit: If you are interested in the implementation of this feature, please upvote - Adding the «Interrupted» property to the Log object
Hi,
Technically, to add some mark at the end of each test is the only solution that I can think of at the moment.
However, IIRIC, interrupted test is marked red, as the failed one (which, technically, is the same).
Can you describe your use case that requires to distinguish between interrupted and failed test?
Hi @AlexKaras
I automatically transfer test result in test management system by API when OnStopTest event is triggered.
Currently when I interrupting Keyword test it continues to stay green. It is wrong information for test management system and I do not need to transfer it. Test will marked red only after OnStopTest event is ended. But after that is no way automatically transfer result to test management system.
Hi,
Hm... Well, I see...
I never checked it, but if you don't mind:
-- This "The test execution was interrupted." message - is it of Error type?
-- If it is, then I would expect it to trigger the OnLogError event;
-- I would expect that this OnLogError event is triggered before the OnStopTest one.
If all above expectations are correct, then you can utilize the OnLogError event to set a flag that the test is interrupted and use this flag in the OnStopTest event handler to make a decision of whether or not the test was interrupted. OnStartTest event can be used to reset the flag.
Hi, @AlexKaras
-- This "The test execution was interrupted." message - is it of Error type? - Yes it is.
-- If it is, then I would expect it to trigger the OnLogError event; - I would expect it too, but OnLogError is not triggered by this message. Don't know why. Maybe it works asynchronous.
-- I would expect that this OnLogError event is triggered before the OnStopTest one. - Often message appears after OnStopTest event is finished.
If all above expectations are correct, then you can utilize the OnLogError event to set a flag that the test is interrupted and use this flag in the OnStopTest event handler to make a decision of whether or not the test was interrupted. OnStartTest event can be used to reset the flag. - Unfortunately, this does not work.
Hi,
Wierd.
I would recommend to open a Support Case via the https://support.smartbear.com/message/?prod=TestComplete form and reference this thread.
I also will appreciate it if you update this thread with the answer from Support.
Thank you for looking into this Alex!
@BVS I wasn't able to find a support ticket from you. Did you solve this issue? Please share your progress with us!
If you didn't solve this yet, this might indeed require deeper investigation from the support team.
Hi @sonya_m .
I opened support Case # 00443874. But now I so busy. I plan to resume conversation soon.
Thanks for the support!
Sure @BVS ! Thank you for updating us.
Let me post a temporary solution to this thread that our support engineers provided you with.
First, they suggest that you create a feature request for adding the «Interrupted» property to the Log object.
And, here's one more suggestion from them:
>>
Also, here is another idea that you can try: save a log to a text file and write a custom script to find the needed "The test execution was interrupted" string in the whole log. Here is the article where you can find more information about the Log object: https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/index.html.
<<
Edit: If you are interested in the implementation of this feature, please upvote - Adding the «Interrupted» property to the Log object
Thank you. New future request was created.