Threaded test execution
Hi,
I'm testing an application where exceptions are caught, then handled in a separate application with a more user-friendly bubble pop-up. We have code that will detect the presence of a the exception bubble pop-up and take the appropriate action already.
However, we have a problem trying to run that check throughout our test. An exception could occur at any point during testing, and may not have an obvious impact on the application, focus also remains with the application during the pop-up.
At the moment, the only way i can see to have this check run throughout is to literally call it after every step like this:
Step 1
> Check
Step 2
> Check
Step 3
> Check
Step 4
> Check
Step 5
> Check
Which seems inefficient and wildly impractical to write. The better option seems like it'd be to thread that checking process so that the execution/writing looks more like this:
Step 1
> Thread
Step 2 Check (looping in thread)
Step 3 Check
Step 4 Check
Step 5 Check
> Kill thread
But i can't see any way to do that in TestComplete, is it possible? The Network Suite doesn't seem like it'd fit the purpose unfortunately, as a test running on one machine won't see the exception bubble generated by another machine.
Thanks,
Chris.
If you want to have a function/routine running on an interval checking for the pop-up every few seconds, you could use a Timer object. Check out https://support.smartbear.com/testcomplete/docs/scripting/timers.html for info.
Note, however, that according to that document, if this pop-up is seen as an "unexpected window", the timer will not execute it's routine.
So, that is actually another way of doing things. There is an event handler for "OnUnexpectedWindow" as well as "OnOverlappingWindow". you could treat that pop-up as one of these. So, check out https://support.smartbear.com/testcomplete/docs/testing-with/running/handling-errors/unexpected-windows.html