Forum Discussion

mithunpal2's avatar
mithunpal2
Contributor
6 years ago

not able to find object

Unable to find the following object when executing the Click command:

Aliases.​browser.​pageVsureLabNmsShawCaLogin.​form.​panel.​fieldset.​textboxName

 

Reason

The parent object was not found:

Aliases.​browser.​pageVsureLabNmsShawCaLogin.​form.​panel.​fieldset

 

Trying to enter some value in textbox but it is failing each time.

10 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    This is probably because the identification properties you are using for fieldset are not static and have changed since you recorded the test. You need to compare what you see in the object browser, vs what you have mapped.

     

    If you can provide screenshots of both the mapped object properties, and the properties in your object browser we can help. 

    • mithunpal2's avatar
      mithunpal2
      Contributor

      Please find attached test screenshots for name mapping and properties in your object browser. I am not able to figure out the issue.

       

      Thanks in Advance

  • I see you don't have much to go on with regards to object recognition for the textbox :smileyhappy:  This error however seems to have to do with the identification properties of the panel containing the textbox.  You may find that there is more to go on with regards to object identification on the panel to ensure it's identified properly

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Note that the object recognition error in your OP is because it is unable to find the parent object, not the text box.  Whatever is mapped as "fieldset" cannot be found.  If the parent can't be found, subsequent child objects will not be able to be found.

       

      Please post the properties and mapping for "fieldset".  Note, also, that there is a link in the object browser when viewing properties to see an "Advanced" view.  That view will expose a LOT more properties so that you may be able to map the object using other values to make the identification more robust.

      • RUDOLF_BOTHMA's avatar
        RUDOLF_BOTHMA
        Community Hero

        tristaanogre wrote:

        Note, also, that there is a link in the object browser when viewing properties to see an "Advanced" view.  That view will expose a LOT more properties so that you may be able to map the object using other values to make the identification more robust.


        Yes, It's rare, but sometimes I have found that the only thing to distinguish two items is that one has no onClick event...

        On a side note, if it is under your control, you could change the ID of the textbox/table.etc. in the markup to make it unique. Sometimes, the best approach to testing is to write your application in a testable manner. A good example of this would be the support for node.js data attributes, where you build the attributes into the markup to help your tests find the items

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    The 'Object not found' error for NameMapped/Aliased objects in almost all cases originates from one of those cases:

    -- Values of the properties used to NameMap the object are not stable. To correct this you must compare existing set of properties/values used in NameMapping with their values for the actual object and edit NameMapping so that the object can be identified stably and uniquely;

    -- Object does not exist at the moment when test code attempts to use it. In this case you need to wait long enough to let the object appear. .WaitAliasChild() method usually works well in this case;

    -- The object was recreated by page script code as a result of either Ajax request or data refresh. In this case you need to get the object again.

     

    Consider when the problem occurs in your test code and what from the above may be the reason for it and correct test code/NameMapping appropriately.

     

  • santi's avatar
    santi
    Contributor

    My suggestion would be, dont go by panel wise search, this is very tricky and may land you in problem in future. Instead go by page object pattern and use locator(s) strategy e.g Xpath (relative) or cssselectror etc. This will save you lot of maintenance in future.

    • AlexKaras's avatar
      AlexKaras
      Champion Level 3

      santi:

      Hi,

       

      > page object pattern

      Namemapping and Aliasing is, actually, much improved version of page object pattern.

       

      > Xpath (relative) or cssselectror

      No. This is a wrong way to go in TestComplete's world. (It will work, but it is far less flexible, reliable and convenient when compared to Aliasing and .FindXXX() methods.)

       

      • santi's avatar
        santi
        Contributor

        For our current application which is electron and angular based alias based was a severe failure, we switched to POP and it worked wonder.

         

        we use combination of Find()/FindChildren() with locator combination and it is amazingly fast for us, after lot of tickets and discussions.