Forum Discussion

rodrigueA's avatar
rodrigueA
Occasional Contributor
7 years ago

bad object highlighted since Name Mapping Repository

Hello,

 

I try to add object in mapping for use in keyword tests. (for smartphone application)

This objects have a ObjectType = Label for all objects.

But there have a ObjectText different for each object. The object text is a product brand.

 

The mapping for this screen is like this :

collectionview

  Collectionview1

      LabelBrandA

   Collectionveiw2

       LabelBrandB

....

 

Problems, it's seems the index of CollectionView it's random. If I restart the page, LabelBrandA can be under CollectionView5...

 

So I map LabelBrandA with properties ObjetcType = Label and ObjectText = BrandA, but sometimes when I relaunch the page, and I make Highlight on LabelBrandA , there is LabelBrandC that it's Highlighted , however LabelBrandC don't has same propertie ObjetcText (Value it's BrandC).

 

So I don't know how I can ask to Test Complete in a keyword test, to search the BrandA in the list,and touch them for go on the page with products of the BrandA

 

3 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    For your Labels, you could make them use extended find which and use some unique property of the label, text could ever work if (although you will have to make sure to wild card it so minor variations won't break you're mapping. 

     

    In a nutshell what this does is allow you to find the label regardless of where it is in the object tree. This way it will not matter which Collection view it is under. 

     

    See http://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/managing/modifying/extended-search-criteria.html for more information. 

    • rodrigueA's avatar
      rodrigueA
      Occasional Contributor

      Hello,


      Thanks for your help. I've modified my mapping for use extend find, and I've deleted dynamic parents.

      Alsoo in keyword test, when I use Find object with Touch operation, it works for first brands, visible on screen, but it doesn't work if brand is on the bottom of the page (necessary to scroll).

      Is it possible to launch the page behind this Brand link, also iit's not visible on the screen?

      • rodrigueA's avatar
        rodrigueA
        Occasional Contributor

        I've resolved this problem by making a scroll before search the object.

        The most often it works, but sometimes (1 time on 10 more or less) there is an other brand that it's launch.

        It seem sometime Test Complete use the position on the screen, however, I've mapped all brand in this screen, with ObjectText that it's property different for each brand.