Forum Discussion

Josh_147's avatar
Josh_147
Contributor
4 years ago
Solved

Image Based Action failed due to TestComplete running dialog blocking

Hi all,

 

I'm trying to use the Image Based Action to simulate a Click action on an object but the object is covered by the TestComplete running dialog when I run the test. Therefore, the Image Based Action operation always failed. Is there any solution for this situation?

 

Thanks. 

6 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Is there any solution for this situation?

    Indicator.Hide() / Indicator.Show()

     

    • Josh_147's avatar
      Josh_147
      Contributor

      Hi AlexKaras 

       

      I've added Indicator.Hide() at the beginning of the test, it works but when the coming step is the Image Based Action, the indicator occurred again.

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        Hm... I see...

        I would ask Support about this.

         

        Meanwhile, you may try not to hide but to move Indicator to some other screen area as per http://www.sqaforums.com/forums/automatedqa-smartbear-testcomplete/65641-move-indicator-post303096.html#post303096

         

        Does this help?

         

        Update:

        Function from the above link updated to work with the modern TC:

         

        // From: http://www.sqaforums.com/forums/automatedqa-smartbear-testcomplete/65641-move-indicator.html?X-ANT-WAF-Attempt=1#post303096
        function MoveIndicator()
        {
          var h, w, i;
          var X, Y;
        
          w = Sys.Process('Test*te').Window('TIndicator', '', 1);
          h = w.Handle;
        
          X = w.ScreenLeft;
          Y = w.ScreenTop;
        
          // Move the window
          for (i = 1; i <= 200; i++)
            Win32API.SetWindowPos(h, Win32API.HWND_TOP, i, i, w.Width, w.Height, Win32API.SWP_SHOWWINDOW);
        
          // Restore the original position
          Win32API.SetWindowPos(h, Win32API.HWND_TOP, X, Y, w.Width, w.Height, Win32API.SWP_SHOWWINDOW);
        }