tmahender12
10 years agoFrequent Contributor
event handlers
What is differencfe between Overlap window event handler and Unexpected window event handler?? attached screen ..iam not able to handle with the eventhandlers...any suggestions??
If a non window dialog box appears in between the tests, then what is the solution??, as the tests are not entereing into Unexpec t window Event handlers, as there is non window dialog,
May be you can handle this dialog using IF/THEN statement?
IF unexpectedObject.Exists THEN do some action ELSE do another action
Does it mean that you can continue your test after this error?
If yes, I believe it is an implementation issue or test environment problem. And better to solve it on the level of developers or system administration. Or you need a wrapper function for each test action, which will check the existence of modal window and click OK if the dialog will be presented.
Hi,
> i do not why test complete enters into pause state it can simply close right?
A possible scenario is when the dialog is created in some event handler within the tested application and the code in the event handler waits until the dialog is closed. In this case the main thread of the tested application is blocked and this causes TestComplete to wait until the thread is unblocked effectively resulting in the dialog is not handled.
If the above is your case, you should use the CallObjectMethodAsync() method (https://support.smartbear.com/viewarticle/74047/) and process the dialog asynchronously.
the error may occur any time....almost there are 1000 methods, i can't keep this in every method...So is there any other solution for this?
So for modal window is there any way to handle by test complete?
Hi,
> So for modal window is there any way to handle by test complete?
Yes, definitely.
Hope, those links will shed some light:
Also try to search the forum - there were several explanations of the Unexpected Window concept here, but I don't have links at hand at the moment...
Still i did not get solution, actually iam getting dialog popo up which is not window, so the window handler event is not triggered.
is there way to handle modal window with available handlers...if still it is confusing for you i can setup a call with you
Hello
currently only way you can handle modal dialog is to implement a function which will check your dialog exists
> Still i did not get solution, actually iam getting dialog popo up which is not window, so the window handler event is not triggered.
Is the window from the attachment a native windows one or a web page modal popup?
The former can be handled using events and event handlers, but the latter cannot. In the latter case you need to implement a loop and wait until the new page is loaded (with, optionally, the required element in it) and, while waiting, check if some web modal window (actually - span, panel or whatever else was used by developers to emulate regular modal window) appears and close the found window if any.
The dialog is generate using messageBox of Dot net, so its for desktop dialog,
Test complete could not identify it as window, it is not detecting the dialog. when ever the dialog pops up if internet is down, then test complete just will be in pause state,
i do not why test complete enters into pause state it can simply close right?
Try to disable debugging, because pausing is a feature of test debugging mode.
thanks for solution, but my scenario is when ever is network is down the modal dialog occurs., so we are not sure when that dialog occurs during 1000 testcases run, and we cant write CallObjectMethodAsync in every test case
attaching the modal dialog
thanks
Mahender
Hi Mahender,
As a workaround, I got the better solution to handle Windowless popup(Model Dialog 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, we are checking whether Windowless popup(Model Dialog popup) exists or not. For more details on Timer object click here
Hope this solution will help You :smileyhappy:
Regards,
BommaReddy