KRogersX's avatar
KRogersX
Frequent Visitor
12 days ago
Status:
New Idea

"CloseAllModalDialogs()" Script Built-In Function

If a Desktop test fails, it can leave modal dialogs open, which will then block any future interactions with the main application window (or other app-owned windows).

It would be nice to have a function that can be called at the start of each test that would ensure that all modal dialogs belonging to the application are closed (including system modals opened by the app, e.g. "Open File" or "Open Folder").

(And something like this would be valuable in Keyword Testing as well.)

 

5 Comments

  • scot1967's avatar
    scot1967
    Icon for Champion Level 1 rankChampion Level 1

    I use a script triggered by the OnStartTest to check the status of tested apps and close or kill processes and start apps as needed.   Maybe a built in function would be good?  There are also a lot of articles about how to deal with modal dialogs.  Drop me a message if you want to know more.  😎

    • KRogersX's avatar
      KRogersX
      Frequent Visitor

      Thanks, Scot.

       I do have a version of this that looks for all specified dialogs and attempts to manually close them. This works, but is quite slow on the .Exists check if the dialog doesn't currently exist. Also, I have no way currently to watch for system dialogs and close them.

      My hope with this feature request is that SmartBear could integrate something into TestComplete that would be faster and more robust than anything I could cobble together in a script.

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        If it's slow, then either adjust your Project Properties -> Playback settings, auto-wait timeout

        Or use WaitNNN methods. 

        Not sure why you are getting "other app-owned windows" interfering with your main application testing?