Forum Discussion

Dhana's avatar
Dhana
Contributor
14 years ago

Handling Unexpected Window

Hi,



I want to clarify whether the LLP will keep performimg its action if an unexpected window occurs while running the scripts, or it will wait till the unexpected window is closed?



If the LLP will continue its action, then i want to make that action to stop temporary untill the unexpected window is been closed. Is there any way i can modify my scipts according to it?



 Please let me know if any way exists and I only want to modify my scripts to perform this action and I don't want any suggestion to change my Default settings like Auto-wait timeout.

3 Replies

  • Hi,


    The low-level procedure is not paused if an unexpected window appears during the run. You cannot temporarily stop the procedure's execution in such cases. As a workaround, you can divide your procedure into two procedures. Then, you can call these two procedures from script. Between the calls, you need to check whether an unexpected window appears and handle it. For example:

    function Test()

    {

      var p, unexpWnd;



      //Execute the first part of the test

      LLCollection1.LLP1.Execute();



      // Handle a possible unexpected window

      p = Sys.Process("MyApplication");

      unexpWnd = p.WaitWindow("MyWindow", "Error", -1, 1000);

      if (unexpWnd.Exists)

      {

         Log.Picture(unexpWnd.Picture(), "An unexpected window is detected.");

         unexpWnd.Close();

      }



      // Continue testing (execute the second part of the test)

      LLCollection1.LLP2.Execute();

     }

  • Thanks, Margaret but this won't work because Unexpected Window occurs when it was not expected so how can I specifically split my LLP as mentioned and also I am not aware when does unexpected window will occur while running my scripts so its impossible to split my LLP. Also i have more 100 scipts in a project where this won't work.  
  • Hi,


    Unfortunately, there is no universal way to stop low-level procedures when unexpected windows appear. So, the only thing you can do in such situations is to analyze your tests to find out what event invokes the unexpected windows. Maybe the same event in your 100 scripts opens the window.


    If you cannot determine what event invokes the window, please send us your project along with the application under test. We will try to help you.