Forum Discussion

DBowerman's avatar
DBowerman
Occasional Contributor
2 months ago

Test case randomly fails with "parent object was not found"

The same automation process can be run repeatedly with several runs completing successfully, but then the same process randomly fails with a "Parent object was not found". I need to understand why this is happening and how to correct.  I'm currently on version 15.62.2.7, but it seems to happen regardless of what version I'm using.

I have tried editing, deleting, and re-recording the object. I have also tried adding, deleting, and modifiy the XPath information of the object and the parent. None of the changes have corrected the random failure.

I've submit a case on this, but if anyone has any suggestions on how to fix/correct it would be greatly appreciated.  Thank you.

 

4 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    By the looks of it, you need to organise your mapped object correctly. Based on the following website http://secure.smartbearsoftware.com/samples/testcomplete15/dialogs/, I have defined the mapped objects as,

    ParentProperty values that defines 'browser'Property value that defines the webpageControlDialog box within the controlShow alert link

    You need to ensure that the structure of your mapped objects is correctly defined, and that it matches your webpage DOM (you seem to have two BrowserWindow beneath chrome?). Ensure that the mapped object property values are also correctly defined (the first xpath for AddWireButton is not correct XPath expression).

    To instruct TestComplete on how to locate the objects in your tested application, name mappings must identify the objects correctly and uniquely.

    • DBowerman's avatar
      DBowerman
      Occasional Contributor

      All objects within NameMapping have been added automatically by the recording process.  Until we started experiencing the random failures, I spent very little time reviewing/updating information in NameMapping. 

      I have a case already opened with SmartBear trying to figure out why NameMapping is creating all these different paths and how to correct.  It's a mess for sure. 

      I'll review the information you provide and see if I can get things cleaned up.  Thank you for responding.

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        While recording, anything you click on, it will automatically create a name mapping. Sometimes it will create duplicates, with different property values.

        When you play this back, TC will get confused, as it doesn't know what actual object you are referring too!

        I create name mappings based on the UI objects I will interact with, slowly building the tree structure. I use Object Spy and Object Browser to find my UI object, right click and select Map Object, followed by Choose a name and properties manually.

        Object Name Mapping

        It is a slow process, but it works 100%