Forum Discussion

Vec84's avatar
Vec84
Contributor
8 years ago

Identifying properties

I have a number of Dynamically loaded side forms which are causing a few issues.

 

The items on the form change when certain things are selected however the label on the form always remains the same

 

Is it possible to use a label as an Idenifying property ? It isnt shown on the available list of properties however i have mapped it to the form.

  • Typically, labels on a form are static objects in their own.  For example, on this page itself, there's a "Subject" field for this message.  That's the data entry field.  The label is the word "Subject" on the line above it.  So, "out of the box" a label is not necessarily an identifying property.

     

     

    This article, however, gives a function that can be used to find an object based upon the object beside it.  This MIGHT work for you.  I haven't tried it, though, so YMMV. https://support.smartbear.com/viewarticle/54646/

     

    Alternative 2: Since the label is a child object of the form, if you map it as a child, you can make it a "required child" in identifying the form. See https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/managing/modifying/required-child-objects.html

     

    Alternative 3: The contents of the form should not change how you identify a form.  So, the fact that the form is changing based upon other selections and that you are losing identification on that form tells me that you are probably using a dynamic property for identifying the form.  This is the grunt work alternative where you will need to spend time going through the properties of the form to find multiple properties.  It probably won't be one or two but a combination of several. I can't give you a "magic bullet" answer to this one... I'm currently doing this myself with my AUT... it takes a bit of time and patience but, eventually, you'll find the right properties.

  • Can you show your object tree?

     

    If I understood you correctly, you have the following structure:

     

    yourForm__
              |__Label
              |__Item1
              |__Item2
              |__Item3
    

    Then you can use "Required Children" option for mapping your form.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Typically, labels on a form are static objects in their own.  For example, on this page itself, there's a "Subject" field for this message.  That's the data entry field.  The label is the word "Subject" on the line above it.  So, "out of the box" a label is not necessarily an identifying property.

     

     

    This article, however, gives a function that can be used to find an object based upon the object beside it.  This MIGHT work for you.  I haven't tried it, though, so YMMV. https://support.smartbear.com/viewarticle/54646/

     

    Alternative 2: Since the label is a child object of the form, if you map it as a child, you can make it a "required child" in identifying the form. See https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/managing/modifying/required-child-objects.html

     

    Alternative 3: The contents of the form should not change how you identify a form.  So, the fact that the form is changing based upon other selections and that you are losing identification on that form tells me that you are probably using a dynamic property for identifying the form.  This is the grunt work alternative where you will need to spend time going through the properties of the form to find multiple properties.  It probably won't be one or two but a combination of several. I can't give you a "magic bullet" answer to this one... I'm currently doing this myself with my AUT... it takes a bit of time and patience but, eventually, you'll find the right properties.

    • Vec84's avatar
      Vec84
      Contributor

      Thanks for the reply, i think the second solution will probably help with this form but i think the third option for other dynaically loaded forms will be needed. The problem with the form is that the options that come up change the size, placement of the items on the form which makes it difficult to find a good property.

       

      What i have found, is that the comboboxes which load up dynamically have the label as the same index. Do you know if it is possible to set a combobox by using the same index property as the label on the form. 

       

      Thanks Again

  • baxatob's avatar
    baxatob
    Community Hero

    Can you show your object tree?

     

    If I understood you correctly, you have the following structure:

     

    yourForm__
              |__Label
              |__Item1
              |__Item2
              |__Item3
    

    Then you can use "Required Children" option for mapping your form.