Forum Discussion

Prodigio's avatar
Prodigio
Occasional Contributor
6 years ago

"The object does not exist" even though mapping seems right

Hello,

I guess this error message have been discussed thousands of times already, but none of the other threads were helping me.

 

I'm creating a installer using Visual Studio and WiX. Testing is performed with TestComplete 12.30.1651.7 on Windows 7.

I've recorded the test several times, did it from scratch again. But it feels like every new build of the installer causes the tests to fail. And I've just talked about the local testing. Doing it on VMs with the help of Jenkins isn't successful either.

 

I can see the the installer process in NameMapping on Mapped Objects and Aliases, but havn't touched Aliases just to be sure. I can even highlight the installer with left click, even though the test failed beforehand. So TestCompelte sees it, but during a test run it doesn't. I've added delays of 10 secons, but even that isn't saving the test from failing.

 

Could it be that creating a new build of the installer and other related software causes some mismatch between the name mapping? And if yes, how to fix it?

 

I'm a bit tired of testing my UI, it isn't reliable at all.

 

Kind regards

Fred

11 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Yes, that is almost definitely the problem.  In your NameMapping, there are most likely properties whose values change each time you build the installer.  I'm guessing that at least a portion of those properties is still static.  You can edit the property values to then use the * wildcard to replace the dynamic portion of the value.  

     

    Another possible problem is timing.  Keep in mind that test automation runs as fast as possible.  So, as soon as it clicks on something, it tries to go on to the next step.  If there are places where there needs to be a delay in order to wait for an object to appear on screen or something else to complete a process, these need to be added after the fact.  WaitChild, WaitAliasChild, WaitProperty, etc... all these methods are specifically in place in order to allow a "smart" waiting for an object or propertiy to resolve before the test continues.

  • cunderw's avatar
    cunderw
    Community Hero

    We need to see screenshots of your object tree for the application, code or KWT examples, and what your name mapping looks like. More than likely because you are just recording the test and letting the object be mapped automatically, you are not providing a good criteria for your mapped objects.

     

    Recording and automatic name mapping is great for a starting point, or figuring out what objects you need, but will never be reliable on it's own. You MUST go in and update your identification properties to something reliable. 

    • Prodigio's avatar
      Prodigio
      Occasional Contributor

      Thanks for your replies so far.

       

      The mapping looks quite simple to me and, as far as I can make out, the static properties TestComplete is looking for, to identify the "msiexec" process, are more or less the same since the beginning.

       

      Here is a screenshot of the object tree:

       

      And here is a screenshot of NameMapping:

       

      And a keyword test for installing:

       

      Fred

      • cunderw's avatar
        cunderw
        Community Hero

        You say "to identify the "msiexec" process, are more or less the same since the beginning." Which leads me to believe maybe something there is changing? In your object tree I also see more than one msiexec object. What does your mapping look like for that? 

         

        Also, where exactly is it failing? And what is the error message for the failure?