Forum Discussion

Ramal's avatar
Ramal
Occasional Contributor
22 days ago

Assistance with Handling Print Dialog Overlap in TC

I am using TestComplete’s Keyword Test feature to record and maintain our regression test suite for a Pharmacy Management Application, which is a WinForms application. I have encountered a few challenges and would greatly appreciate your guidance.

  1. Handling Multiple Print Dialog Overlap:During playback, there are instances where multiple Print Output dialog windows overlaps  causing TestComplete to fail as it cannot detect elements correctly. Could you please suggest checks, operations, or settings I can add to ensure TestComplete consistently handles this scenario? Refer image 1 
  2. Failures in Execution Plan:
    When I place my keyword tests in an execution plan and run them as a project, they fail for unclear reasons. However, when running the tests individually, they execute without issues. How can I debug or prevent these inconsistencies?Refer image 2
  3. Email Notification on Test Failure:
    Is there a specific operation I can add to my keyword test to automatically generate and send an email whenever a test fails? 

Thank you in advance for your assistance. Any suggestions, best practices, or references would be greatly appreciated.

  • JDR2500's avatar
    JDR2500
    Frequent Contributor

    Hi, I don't see any attachments.  When test(s) fail it's very helpful if you can provide the log contents and the code/keyword steps you're trying to execute.

      • JDR2500's avatar
        JDR2500
        Frequent Contributor

        Using a name mapping for those dialogs is almost certainly going to result in an ambiguous object recognition warning when both appear on the screen at the same time.  However, TestComplete can distinguish them by index.  In my example below you can see I have two Explorer windows open at the same time.  The Object Spy shows an index that distinguishes them. 

        If I wanted to click on the first one, I would address it in the keyword test using the index "1" something like this:

        If I wanted to work with the other Explorer window then I would use the index 2.  As long as you use the correct index TC should be able to distinguish the two dialogs allowing you to target the desired one.

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    1. When the Print Dialog appears, what actions are you performing? Are you actually printing or saving the print output to PDF? What elements can not be detected? Showing log errors helps us in diagnosing the issue and providing a possible solution.

    2. Without log files, it's difficult to provide you with suggestions.

    3. It is possible with Sending Email From Scripts, but depending how your email server is setup, it might not be possible.