locked
UITestControl.FindMatchingControls() method is throwing TechnologyNotSupportedException on Windows10. RRS feed

  • Question

  • Below code is throwing Microsoft.VisualStudio.TestTools.UITest.Extension.TechnologyNotSupportedException: To test Windows Store apps, use the Coded UI Test project template for Windows Store apps under the Windows Store node.

    PropertyExpressionCollection sp = new PropertyExpressionCollection();

    sp.Add(WinWindow.PropertyNames.ControlType, "Window");

    UITestControl u = new WinWindow();

    u.SearchProperties.AddRange(sp);

    UITestControlCollection uc1 = u.FindMatchingControls();


     
    Friday, January 6, 2017 11:04 AM

All replies

  • Hi Nagalakshmi.Ch,

    Based on your codes, I have found some doubts about it. Here is my opinion (in my windows store, I have added an Edit control):

    1). With the following code, I could use the FindMatchingControls() method, and found the XamlEdit control.

    XamlEdit u = new XamlEdit();
    u.SearchProperties.Add(XamlEdit.PropertyNames.ControlType, "Edit");
    UITestControlCollection uc1= u.FindMatchingControls();
    

    2). Then in your code, you are using WinWindow, whether we need to change it to Window or UITestControl?

    3). You are using AddRange() method, please press F12 to see its input parameters:

    I have not find PropertyExpressionCollection parameter.

    4). But in my side, when I use PropertyExpressionObservableCollection, I always get the following error:

    5). I am using VS2015 Enterprise Update3, please share me which version of VS you used? I will try my best to repro your issue in my side, and you could try to use the step1 method in your program.

    Sincerely,

    Oscar


    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.

    • Proposed as answer by Oscar_Wu Tuesday, January 10, 2017 9:53 AM
    • Unproposed as answer by Oscar_Wu Monday, January 16, 2017 5:01 AM
    Monday, January 9, 2017 8:18 AM
  • Hi Oscar,

    Thanks for replying.

    We are not testing windows store applications, we are testing windows desktop applications. 

    I could see PropertyExpressionCollection as parameter. I am using VS2015 Enterprise Update3.

    This is happening when we are calling FindMatchingControls() method on the control which has only controltype search property.

    Regards,

    Nagalakshmi

    Monday, January 16, 2017 4:02 AM
  • Hi Nagalakshmi.Ch,

    In your original post, you said to test Windows Store apps, whether it is win8.1 app or UWP app? And now you said you are testing windows desktop applications, whether it is winform or wpf? Please share me this answer.

    Sincerely,

    Oscar


    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, January 16, 2017 6:47 AM
  • Hi Oscar,

    I did not say that i am testing windows store application. In my original post, i mentioned about the exception message. Below exception message is thrown by FindMatchingControls() method.

    To test Windows Store apps, use the Coded UI Test project template for Windows Store apps under the Windows Store node.

    I am testing Winforms application on windows 10 with Visual studio 2015 enterprise Update 3.

    Regards,

    Nagalakshmi

    Monday, January 16, 2017 11:11 AM
  • Hi Nagalakshmi.Ch,

    There is conflict between your information.

    >>throwing Microsoft.VisualStudio.TestTools.UITest.Extension.TechnologyNotSupportedException: To test Windows Store apps, use the Coded UI Test project template for Windows Store apps under the Windows Store node.

    This error message reminds us we need to use the following template:

    And you said you are testing Winform, so we need to use this template:

    So above is my doubts, and please make sure you have selected a correct Coded UI template. Please let us keep in touch. : )

    Sincerely,

    Oscar


    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.


    • Edited by Oscar_Wu Tuesday, January 17, 2017 3:21 AM
    Tuesday, January 17, 2017 3:21 AM
  • Yes you are correct. CUIT is throwing irrelevant exception message.

    I am using below template for WinForms Application. 

    Please try below workflow and let me know if you can not reproduce the issue.

    1. On windows 10 OS and Visual studio 2015 enterprise Update 3, Create a new CodedUITest project with the above mentioned template.

    2. Type below code in the RecordedMethod1 and execute the test

    PropertyExpressionCollection sp = new PropertyExpressionCollection();

    sp.Add(WinWindow.PropertyNames.ControlType, "Window");

    UITestControl u = new WinWindow();

    u.SearchProperties.AddRange(sp);

    UITestControlCollection uc1 = u.FindMatchingControls();

    3. Exception will be raised at FindMatchingControls() method.

    Regards,

    Nagalakshmi

    Friday, January 20, 2017 7:02 AM
  • Hi Nagalakshmi.Ch,

    Yes, I could repro your issue in my side, but I have modified your code then run it successfully.

    Sincerely,

    Oscar


    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.

    Friday, January 20, 2017 7:18 AM
  • Hi Nagalakshmi.Ch,

    Please refer to the following screenshot to get above code correctly:

    If my reply help you resolved this issue, please remember to mark is as answer, which could be helpful for others who have the same issue as yours. :)

    Sincerely,

    Oscar


    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.


    • Edited by Oscar_Wu Friday, January 20, 2017 7:23 AM
    Friday, January 20, 2017 7:23 AM
  • Hi Oscar,

    I am already aware of this change with which it will run to success. But my requirement here is to find all window controls with out providing the name. 

    Regards,

    Nagalakshmi.Ch

    Friday, January 20, 2017 7:24 AM
  • Hi Oscar,

    Searching all windows without providing name works fine on other versions of OS. I believe that this is a regression from CUIT. And the exception message is also very irrelevant to this CodedUI template.

    Regards,

    Nagalakshmi

    Friday, January 20, 2017 7:26 AM
  • Hi Nagalakshmi.Ch,

    Whether you could use the following code:

      sp.Add(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains);

    Because during the identify, Coded UI Test Builder does not use ControlType property.

    Sincerely,

    Oscar


    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.


    • Edited by Oscar_Wu Friday, January 20, 2017 7:33 AM
    Friday, January 20, 2017 7:32 AM
  • Hi Oscar,

    I can not use Classname property for the search. We have only controltype as search criteria.

    Same code works fine on previous versions of Windows, This seems to be a regression from CUIT method. Even the error message is very irrelevant.

    Please provide a fix for this issue from Coded UI side.

    Regards,

    Nagalakshmi.Ch

    Monday, January 23, 2017 4:40 AM
  • Hi Nagalakshmi.Ch,

    Based on your idea, I could repro your issue in my side. I have tested this code in my Win7 and other Win10 machines, and the results are the same in Win10 machines. But it works fine in Win7.

    In Win 10 machines, I could not identify the window with only TechnologyName property.

    My Win10 OS version is:

    Windows 10 Enterprise 64-bit (10.0, Build 14393).

    So I think this is bug in Win10 OS, I help you submit a bug to VS connect with the following link.

    I think engineers from the MS will evaluate this issue seriously.

    https://connect.microsoft.com/VisualStudio/feedback/details/3119352

    Here is the test code to repro this issue:

               

     PropertyExpressionCollection sp = new PropertyExpressionCollection();
                //sp.Add(WinWindow.PropertyNames.ClassName, "WindowsForms10.Window", PropertyExpressionOperator.Contains);
                sp.Add(WinWindow.PropertyNames.ControlType, "Window");
                UITestControl u = new WinWindow();
                u.SearchProperties.AddRange(sp);
                UITestControlCollection uc1 = u.FindMatchingControls();
                foreach (var test in uc1)
                {
                    test.DrawHighlight();
                }
    

    Nagalakshmi.Ch, please mark this reply, which could help others to add comments to that bug. And whether you could use Win7 OS to test your project?

    Sincerely,

    Oscar


    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, January 23, 2017 7:10 AM