Forum Discussion

Ramal's avatar
Ramal
Occasional Contributor
23 days ago

Challenges with TestComplete Record and Playback for Enterprise Desktop Application

Hi SmartBear Community,

I am using Record and Playback in TestComplete to automate our current regression test suite for an enterprise desktop application (a pharmacy management system). Since my team doesn’t have technical experience in coding, Record and Playback seems like the most straightforward approach for us.

I’ve successfully recorded test cases for a few modules but I’m facing a recurring issue during playback:

  • Test cases fail during playback, even though the objects in question are present and haven’t changed.
  • I’ve tried adding if-else conditions and delays, but these sometimes don’t resolve the issue.
  • When I re-record the failing steps they work fine temporarily but the issue reappears during subsequent regression cycles.

Could you please advise if the Record and Playback technique alone is sufficient for reliable automation in this scenario or if there are other best practices to improve stability and prevent these failures? Specifically:

  1. How can I improve object recognition and stability?
  2. Are there any settings or configurations in TestComplete I should adjust to make tests more robust?
  3. Is there a way to minimize the need for frequent re-recording while still avoiding scripting?

Your guidance would be immensely helpful as we aim to streamline our regression cycle using automation without diving into coding.Challenges with TestComplete Record and Playback for Enterprise Desktop Application

Thank you so much for your support!

Best regards,

Ramal 

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    Hi Ramal,

    It's hard to say exactly what's going wrong however, the fact that you can re-record and that works is a clue.  That would tend to lead me to believe the object identification properties aren't ideal.  More specifically, they may be using a property that isn't static.

    Normally the error in the log is more helpful when that is the case.  Nevertheless, I would start with checking the name mapping properties for your objects and make sure they are using properties that you are confident won't change from run to run.  Some object IDs and other properties in applications can be created at runtime.  The name mappings much be configured to accommodate that case.

    For instance, in our desktop application each window has a WndClass.  However, that class can change.  I use that property in the name mappings with a wildcard because I know the first part is always the same (e.g. "Afx:00*").  In combination with the WndCaption I have unique identification properties.  In the below case I've wildcarded two of the identification properties that I know can change.

    Name mappings are created automatically during recording.  Unfortunately, they aren't always created with reliable properties.  I always go back and fine tune them.

    Getting the hang of name mapping takes a little while.  Once you figure it out you can make your test more robust and performant.  If you haven't read the help topic check it out here:
    Name Mapping | TestComplete Documentation

    Good luck, John

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    For TestComplete to recognise your UI objects, you first need to understand https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/index.html - you need to ensure your criteria is defined correctly for your UI objects, which TestComplete will then use to search for the object.

    If find the property values are changing, then you can use https://support.smartbear.com/testcomplete/docs/reference/misc/using-wildcards.html 

    Refer to https://support.smartbear.com/testcomplete/docs/app-testing/desktop/net/index.html if you application is .Net