Forum Discussion

ngladysz's avatar
ngladysz
Occasional Contributor
12 years ago

Clicking a UIA object

Our AUT has a custom control that is like a grid and manually draws it's cells on a "render surface".  These cells are completely custom and do not inherit from any Microsoft library classes (i.e. FrameworkElement).  We have a need to automate interactions with this custom control so we decided to look into AutomationPeers.  I have tested this approach and TestComplete is able to recognize the custom UIA objects; however, when I try to click one of the cells in this custom grid it simply clicks the middle of the window.  The AutomationPeers for these cells override GetClickablePointCore and provide a correct point to be clicked for that object, but it still doesn't click in the right place.  Is this a known issue?

5 Replies

  • Anonymous's avatar
    Anonymous

    Hi Nathan,



    Could you please share with us your recorded test with the test log of its execution?
  • ngladysz's avatar
    ngladysz
    Occasional Contributor
    Thanks for the reply Tanya.  I've actually solved this issue.  I found that the bounds for a UIA object should be screen coordinates and not relative to the current coordinate system.  I do however have another question.  I've already posted this question on the SqaForums but I have not had a response in about a week.  Up until now we have been using Custom Extensions to automate our own custom control but we want to use a better strategy for our future releases. We considered AutomationPeers; however, after investigating TestComplete's UIA objects and the support for AutomationPeers it seems like it doesn't allow for much, if any, customization. "...if your application implements a custom provider exposing specific properties, they will not be available to TestComplete." I got this quote from here: http://support.smartbear.com/viewarticle/30724/. That seems to be true, but it also doesn't seem to be possible to expose any methods or properties in even the standard providers written by Microsoft.



    The following has been my approach up till now. I have a custom automation peer class that inherits AutomationPeer and implements a standard provider like IScrollItemProvider. In TestComplete I can see the UIA object and all the standard AutomationPeer properties but none of the IScrollItemProvider properties or methods. I understand that a custom provider like ICustomProvider wouldn't work, but why wouldn't the standard ones work? Am I missing something or is this just not supported?  Thanks again.
  • ngladysz's avatar
    ngladysz
    Occasional Contributor
    For some reason I can't see my latest reply or yours in the SQA forums thread.  I discovered the issue and fixed it.  I needed to define the patterns for my custom automation peers.  Once the patterns were defined I could see the respective properties/methods in TestComplete.  Thanks Tanya.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Nathan,


     


    Actually, our Support has already replied to your colleagues on this question:


    This is the expected behavior - currently, IScrollItemProvider is not handled by TestComplete. However, if you provide us with a sample application demonstrating the problematic behavior (not necessarily the application you test), we can try to investigate this behavior and will consider implementing support for IScrollItemProvider in TestComplete.


    So, if you are interested in resolving this behavior, provide the Support team with the requested information.