Forum Discussion

sree2011's avatar
sree2011
Contributor
9 years ago

Getting Automation ID Property in Test Complete 10.6

We are currently using Test Complete 10.6 version. Our application is developed in WPF and application controls are having automationproperties.automationid property defined to uniquely identify each object. We need to find the control using this AutomationId property. We have done a work around to get the object using "AutomationID = MyObject.GetValue(AutomationIdProperty)". Is there any possible way to find the object using the Automation ID property directly. Please help on this.

5 Replies

  • Hi sree2011,

     

    You could use one of the "Find" methods as described here: http://support.smartbear.com/viewarticle/55436/.

     

    You can use to "root" of the application in the TestComplete's Object Browser to search for the desired object using it's Object ID. For example you could do the following:

     

    var PropArray = ["AutomationId"]

    var PropValue = ["MyID"]

     

    Sys.process("My_Application").Find(PropArray, PropValue).

     

    Let me know if that helps.

     

    Regards,

     

    Leandro de Araújo Souza

    • sree2011's avatar
      sree2011
      Contributor

      Hi Leandro,

       

      Thank you for your Reply. I tried the same what you had mentioned but the object returned empty. I tried to use the Find method to get the object using AutomationId property, but was not able to find the same. I then tried to use the Find method with the name property and i was able to get the correct object. AutomationId property is an attached property in .net and it is also not visible in the object spy properties. So I believe FInd method can only find the objects which are shown using the Object Spy. Could you please let me know if there is any other way by which we can find the object using Automationid property as our developers use only AutomationId property to uniquely identify the objects. Your valuable suggestions would be a great help to me.

      • sree2011's avatar
        sree2011
        Contributor

        Hi Leandro,

         

        Could you please help me on this.

    • seek07's avatar
      seek07
      Regular Visitor

      I am having a similar issue with automation ID in a WPF application. The developers attached an Automationid to an object, but I am not able to see it using an object spy or the "find" method. I would like to be able to call objects using automationid rather than mapping due the constant changes in the mapping. Any suggestions on how I will be able to see an automationid that is attached to an object?

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        Have you read this? ... http://support.smartbear.com/viewarticle/72878/

         

        Specifically, the important notes and bit about methods and properties unavailable to TestComplete?

         

        If this ID property is something your devs have added, I assume it would be a non-standard property of the object. There are a couple of settings you can alter to try and get to those, mentioned in the above article and links from it.