Forum Discussion
What happens if this window is opened? Does your test fail and throw some kind of error message? If so, you can try to handle your case using OnLogError event. You can check this window existence each time, when TC posts an error message to the log.
Hi All,
As a workaround, I got the better solution to handle Windowless popup(Model Based popup)
By using Timer Object we can overcome this problem. Write the following code in event handlers.
OnStartTest:
Sub OnStartTest(Sender) Dim MyTimer Set MyTimer = Utils.Timers.Add(8000, "unit1.TimerRoutine", True) MyTimer.Name = "ModelPopUp" Log.Message "Timer ON" End Sub
OnStopTest:
Sub OnStopTest(Sender) Utils.Timers.Items("ModelPopUp").Enabled = False Log.Message "Timer OFF" End Sub
unit1.TimerRoutine:
Function TimerRoutine 'write the code to check whether popup exists or Not If popup=True Then 'close popup (or) Click End If End Function
Before script starts, the controller will go to OnStartTest and activate Timer Object. Once Timer triggers, TestComplete pauses the test to run the timer’s routine. The test is resumed after the timer routine has finished running.
So for every 8sec, i am checking whether Windowless popup(Model Based popup) exists or not. For more details on Timer object click here
Regards,
BommaReddy
Hello,
What's 'unit1' here. I don't understand. Talking in Javascrip context, I was testing this and instead of unitname.timeRoutine, I'm using just the routine name and I get this error.
MyTimer = Utils.Timers.Add(10000, "StartUp.timeRoutine", true);
do you know why that would happen?
Error:
Unable to find the timer procedure "timeRoutine".
Thank you
Al
- tristaanogre6 years agoEsteemed Contributor
This thread is almost three years old and so a lot of context might have been lost. It is entirely possible that the error that you're experience is unrelated.
Please post your question in a separate thread as this one has been marked resolved. Al2 :
Hi,
> Set MyTimer = Utils.Timers.Add(8000, "unit1.TimerRoutine", True)
> What's 'unit1' here.https://support.smartbear.com/testcomplete/docs/reference/program-objects/timers/add.html
Does it help?