locked
Coded UI not using Automation ID for Win32 app that is written to support UIA RRS feed

  • Question

  • I was trying to implement (learn) how to use IRawElementProviderSimple and have copied most of the code from "UI Automation simple provider sample', see link below for the source code. I have also added the following into Provider.cpp

    else if (propertyId == UIA_AutomationIdPropertyId)
    {
        pRetVal->vt = VT_BSTR;
        pRetVal->bstrVal = SysAllocString(L"This.Is.My.Automation.Id");
    }
    

    In short, the custom control now has an Automation ID. The issue I am having is that Coded UI is detecting the control as MSAA therefore not using AutomationID. Can someone please provide input on what is the best way to use Coded UI for native applications that implements UI Automation Provides?

    Link:

    https://code.msdn.microsoft.com/windowsdesktop/UI-Automation-Simple-735d36a5

    Repost from as advised:

    https://social.msdn.microsoft.com/Forums/en-US/f200c4af-26f9-4244-9361-815dfaa0f868/coded-ui-not-using-automation-id-for-win32-app-that-is-written-to-support-uia?forum=csharpgeneral


    yY

    Saturday, February 23, 2019 12:38 AM

All replies

  • I was trying to implement (learn) how to use IRawElementProviderSimple and have copied most of the code from "UI Automation simple provider sample', see link below for the source code. I have also added the following into Provider.cpp

    else if (propertyId == UIA_AutomationIdPropertyId)
    {
        pRetVal->vt = VT_BSTR;
        pRetVal->bstrVal = SysAllocString(L"This.Is.My.Automation.Id");
    }
    

    In short, the custom control now has an Automation ID. The issue I am having is that Coded UI is detecting the control as MSAA therefore not using AutomationID. Can someone please provide input on what is the best way to use Coded UI for native applications that implements UI Automation Provides?

    Link:

    https://code.msdn.microsoft.com/windowsdesktop/UI-Automation-Simple-735d36a5


    yY

    Friday, February 22, 2019 5:43 AM
  • https://social.msdn.microsoft.com/forums/vstudio/en-us/home?forum=vsunittest

    It's where you can post for help.

    Friday, February 22, 2019 9:16 PM
  • Hi Tamilarasu Muthusamy,

    Thank you for posting here.

    Since this thread is related to Visual Studio Unit Testing,  I will merge it to Visual Studio Unit Testing forum for suitable support.

    https://social.msdn.microsoft.com/forums/vstudio/en-us/home?forum=vsunittest

    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    Best regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 25, 2019 2:52 AM
  • Hi friend,

    Welcome to MSDN forum.

    Sorry for the delay. I've reproduced this situation in VS2017. And it seems to have something to do with the support by CUIT framework. I've found a similar issue in stackoverflow and he figured it out by coding custom server-side provider. 

    Please take a look at this similar issue, hope you can get help from it. 

    Cause i'm not familiar with C++ language, i can't write the C++ sample to check if it works. Sorry for this in convenience and do hope you can understand.

    Any update please feel free to contact us. We'll try best to help you.

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 26, 2019 9:05 AM
  • Can you please share sample code how to write custom plugin for CUIT? I thought I tried that route but I couldn't get it to work.

    yY

    Tuesday, March 5, 2019 6:32 PM
  • Hi friend,

    Thank you for your feedback. You can get the code tutorial about support from CUIT framework from this doc

    <<Coded UI is detecting the control as MSAA therefore not using AutomationID

    And does the Coded UI you mentioned refer to Coded UI Test Project in Visual Studio? Since I've rechecked your link above.  It seems that you're developing UI automation windows desktop application. 

    Since this is Test forum, we discuss issues mainly about test methods and test tools. I suggest you open a new thread at Desktop AutoMation forum to get more professional support. And I can help move this thread to that forum if you approve. 

    Best Regards

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, March 6, 2019 2:44 AM