none
Can we use fakes to test AutomationElement methods

    Question

  • Hi Everyone,

    We are evaluating Microsoft "Fakes" frame work to write logical to test AutomationElement methods. My method is 

    =============  Actual Method =======

      public static string GetControlType(AutomationElement.AutomationElementInformation aeControl)
     {
              return aeControl.LocalizedControlType;
     }

    -----------------------------------------------------------

    ================= Test Method ================ 

    [TestMethod()]
            public void GetControlTypeTest()
            {
                using(ShimsContext.Create()
                {
                    ShimAutomationElement.ShimAutomationElementInformation fakesControl;                
                }}            
     ----------------------------------------------------

    I don't find any 'LocalizedControlType' on fake control.

    Can anyone help me here to write logical UTs for above method?  I am using VS 2012

    Regards,

    Rajendar.


    • Edited by Rajendar M Monday, June 23, 2014 6:07 AM
    Friday, June 20, 2014 7:10 AM

Answers

  • Hi Rajendar,

    Glad to see you again:)

    I also didn't find the official information which said that it supported the AutomationElement method.

    As my understanding, the real issue is that which kind of app you are testing and what function your method in your project has, we also need to know the real functions and requirements of Fakes:

    http://msdn.microsoft.com/en-us/library/hh549175.aspx

    Maybe you could submit this feature request: http://visualstudio.uservoice.com/forums/121579-visual-studio.
    The Visual Studio product team is listening to user voice there. If you submit it, please share me the link, I will help you vote it.

    Sincerely,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 23, 2014 9:53 AM
    Moderator