Forum Discussion

peejay1977's avatar
peejay1977
Occasional Contributor
6 years ago

Newbie question around desktop UI testing

Hi all, firstly apologies for the potentially super simple nature of this query. My previous automation testing experience was limited to an in house developed framework with simple language to write automated tests in.

 

I've come to a new company and we need to start automating the various systems we use, one happens to be a 3rd party accountancy product which runs on Windows.

 

We are currently trialling TestComplete with a view to purchasing it but I think my lack of code level experience is hindering me from providing my manager with a proof of concept that we can use it for our needs.

 

I have a test case which I used the record function to map out as I configured a client within the desktop app, but on playing the converted code back (with alterations) the outcome is different and fails.

 

The record converted code is something like this:

 

Aliases.ClientFrameWork.frmMain.mainTab.splMain.SplitterPanel.tabMain1.UITabPage8.frmClient.tbMainTab

 

Which when I play back fails because despite the UT Tab on a different client being in the same place within the app, and in the exact same spot on the screen, it seems to often have a different value and I'm struggling to understand how to work around this so that I can consistently ask it to navigate to the correct tab.

 

Paul.

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Hi!  Welcome to TestComplete!

    One of the things to understand about how TestComplete works is that, at the core of the tool, is a feature called NameMapping which is how TestComplete identifies objects for interaction.  NameMapping uses a combination of object hierarchy and object properties to identify the specific object.

    So, one thing that happens frequently is that object properties, many times, have a dynamic nature where the values of those properties change due to many factors.  There are ways of mitigating this such as selecting different, more static properties for identification, using wildcards in the object identification properties, etc.

    Basically, when you recorded your test, the objects were mapped automatically with properties and property values at the time of recording.  When you play back the test, if there were such dynamic properties, the objects are not identified because those properties changed since the test was recorded.  

    This is one of the "dangers" of record/playback method of creating automated tests.  It really is a powerful way of getting started... but it is a rare application that works 100% well with record playback.  I would say at LEAST 90% of the time, after you record something, you will need to go back and make multiple adjustments to object mapping and in playback timing.

     

    For Object Mapping, I would start with reading https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/overview.html and all the various literature on that.

     

    For Timing, I would read the topics under https://support.smartbear.com/testcomplete/docs/app-objects/common-tasks/index.html

     

    Please feel free to continue to ask specific questions here.  We're happy to help newbies. :)