Forum Discussion

LonewolfQA's avatar
LonewolfQA
New Contributor
7 years ago

Desktop Automation Window Update

I am currently attempting to automate my companies software however every time there is a new build the program window name is being incremented for example if I record an automation the application window will be lw00000 but if I am to update the program it will rename the window to lw00001 making TestComplete unable to locate the object in the renamed window.  I have tried updating the the window name in the test which it does successfully but does not update the commands that are to be performed in the test.  Each command has to be updated individually, which is slower than re-recording a new test.  Is there a way that I can update the window name and keep the commands that are performed within that window?  Thanks.

  • Something else to look at has to do with the mapping... and this is probably where your solution is going to be.

     

    If the properties being used for identifying the window contain values that change every build, then you may need to either consider using different properties for identification or use wildcards in the property values to account for the variability.

     

    In your example, you mention a value that changes from lw00000 to lw00001.  If that value is one of the properties used for identifying the object, you could replace that value in your NameMapping to lw*.  This will make that property match no matter what application build it is.

     

    Of course, this is a simplistic answer but it is one thing to consider.  As shankar_r suggested, we can give more directed answers if we can see the object browser properties of the window in question.

  • The wildcarding is not done in the test case itself but in the NameMapping.

     

    In your project explorer, double click on the node that says "NameMapping" and, in the Aliases section, find where those objects are.

     

    Basically, you need to modify the mapping criteria for your objects so that they handle the dynamic identification easier.

    For more info, https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/managing/modifying/index.html

  • shankar_r's avatar
    shankar_r
    Community Hero

    It would helpful to answer if you provide some screenshots of window and it's object browser properties 

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Something else to look at has to do with the mapping... and this is probably where your solution is going to be.

       

      If the properties being used for identifying the window contain values that change every build, then you may need to either consider using different properties for identification or use wildcards in the property values to account for the variability.

       

      In your example, you mention a value that changes from lw00000 to lw00001.  If that value is one of the properties used for identifying the object, you could replace that value in your NameMapping to lw*.  This will make that property match no matter what application build it is.

       

      Of course, this is a simplistic answer but it is one thing to consider.  As shankar_r suggested, we can give more directed answers if we can see the object browser properties of the window in question.

      • LonewolfQA's avatar
        LonewolfQA
        New Contributor

        Hello Robert first of all thank you very much for your reply.  I am unsure of how much of my companies information I can show so I am hoping that if give you an example of two test that are supposed to do the same thing but have the incremented window values.  Both tests are designed to log into our companies product using our admin login.  The parts that I redacted are the login credentials.  The full object path of the first click (highlighted line) is  Aliases.lwrms.wndLwRMS9c000000.LwRMS9c000000.LwRMS9c000000 for this first screenshot.

         

        In Login 2 that same highlighted line's full object path is Aliases.lwrms.wndLwRMS9c0000002.LwRMS9c000000.LwRMS9c000000.

         

         

        I attempted to make the object paths Aliases.lwrms.wndLwRMS9c*.LwRMS9c000000.LwRMS9c000000 which I believe is what you were trying to get at but it would not accept that.  I am fairly unfamiliar with test complete and doing my best to learn more.  I will talk to my boss about trying to get you more information. If you need more information please ask.  Thanks again.

    • LonewolfQA's avatar
      LonewolfQA
      New Contributor

      Hi Shankar please see my reply on Roberts post,

       

      Thanks!