Forum Discussion

leonardopscruz's avatar
leonardopscruz
New Contributor
6 years ago

Can't spy an object inside Windows Security popup

I have an application that is utilizing TestComplete to Spy Objects. The Spy functionality works with any window, except the "Windows Security". When we try to Spy any object inside that window, then an excetion is thrown. I realized it happens when my code is calling for the ObjectFromPoint method (https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/desktop/objectfrompoint-method-desktop-object.html) . The line from my code where error is raised is like this:

 

obj = Sys.Desktop.ObjectFromPoint(px, py, true);

 

The message we get is the one as bellow:

 

Here are the version of softwares I'm utilizing:

SmartBear TestComplete 11 - Version 11.31.2420.7

SmartBear TestExecute 11 - Version 11.31.2420.11

 

 

As it is a problem with TestComplete, then I'm not being able to overcome this issue on my app. Can someone please help?

6 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    How exactly is your app utilizing TestComplete as an object spy?  Do you mean that you are using the TestComplete Object Spy to look at your app?

     

     

    • leonardopscruz's avatar
      leonardopscruz
      New Contributor

      My app has a control which user can drag and drop into any window. When dropping, then we run the Sys.Desktop.ObjectFromPoint to identify which object it is based on the coordinates where it was dropped.

      So, basically, when we utilize the Sys.Desktop.ObjectFromPoint method passing the coordinates of an object within the Windows Security popup, then an exception is raised as that method is not able to identify the window we're spying (as picture in my first message).

       

      Also, I realized that when opening TestComplete, then opening a project, then clicking the 'Display Object Spy' button at top of TestComplete, and then draging and dropping the target into any object from same Windows Security popup, then the object is recognized and works as expected. So the problem happens only when we are spying the object via a customized app, utilizing the Sys.Desktop.ObjectFromPoint method. And just to remember that the error is raised by the ObjectFromPoint method, not by my application code itself.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Verify the co-ordinates are correct.  It's entirely possible that those co-ordinates, when selected, aren't finding anything at that point that can be recognized as an on screen object of some sort.