Forum Discussion
Hi Alex,
Thanks for your reply. I work with the OP who is off today so I am going to answer in his place to help us get to the bottom of this :-).
So, your example of " if test code entered wrong data into a form field and this caused display of modal warning window and test code tries then to click the OK button on a form, the click will be blocked because of the modal window" is exactly what is happening. You say however that "an OnUnexpectedWindow event will be triggered". Ok, so that is following with the documentation we see in a link like this: https://support.smartbear.com/testcomplete/docs/testing-with/running/handling-errors/unexpected-windows.html where it says that TC waits until the auto-wait timeout period expires, then fires OnUnexpectedWindow.
What we are really curious about is why step 3 on that page is not happening, where if the window is not closed by the handler, then TC goes through a series of steps to close the modal - pressing ESC key, pressing ENTER key, sending close command to the window. We can't seem to get this behaviour to happen - right now if a modal pops up and we do not have a handler for it it is just failing our test because TC is never closing the window. We have an understanding from the docs that TC can and will handle these modals without us having to specifically code for them....?
We have used TestComplete for 6 or 7 years now and are on our second iteration of creating tests for our application. We cannot now, nor have we been able to in the past, get the automatic handling of unexpected windows to happen. Our previous GUI test code we coded some special handling for all unexpecteds, but this time around would like to see if we can get TC to handle it and save us some of the work involved.
Hi,
> why step 3 on that page is not happening
Have you checked settings mentioned for the first two paragraphs of step 3?
According to the documentation, TestComplete tries to close unexpected window only in the case when it is not commanded to stop test run. If, according to settings, test run must be stopped, then TestComplete does not try to close the unexpected window.
- ddguy5 years agoOccasional Contributor
Hi Alex,
All of our error handling settings tell TestComplete to Continue running on error, on object recognition error, and on warning.
I have attached an image of our TC settings.
- AlexKaras5 years agoChampion Level 3
Hi,
What about Test Items settings (https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/project-editor/test-items-page.html) mentioned under first bullet for the step 3 being discussed?
- ddguy5 years agoOccasional Contributor
Hi Alex,
All of our test items use the project's 'On error' property, which in turn is configured to continue running in the event of any errors. Are there any other settings that may overwrite this, or any other checks we should do to make sure the "on unexpected window" behavior is reached?
Many thanks,
Dan
Related Content
- 5 years ago
- 5 years ago
Recent Discussions
- 49 minutes ago
- 9 hours ago