bo_roop's avatar
bo_roop
Contributor
8 years ago
Status:
New Idea

Two-step logging of images when a test fails

It would be nicer if TestComplete could take two screenshots when a test fails. One immediately when the error is encountered and a second after the ten second (default value) timeout for an action to fail.

 

Frequently we see that the clicking of a control (be it a link, a button or something else) fails, but by the time the screenshot appears in the log, the missing item is present. This makes it very difficult to debug if you're not running the test on your local machine. Running on a remote VM is always slower and shows off many more synchronization issues for us... and makes it very difficult to debug with just the log files.

 

The log claims a link was clicked, but all we see in the screenshot is the mouse hovering over the link. Likely it was there, but not visible onscreen so the tool thinks it succeeded, but didn't really do anything. We're still waiting for a new window to open which never will. :(

 

If we had two screenshots, we could see if the link as really present or not.

1 Comment

  • Ravik's avatar
    Ravik
    Super Contributor

    Hi,

     

    You can create your own custom function which is checking whether object is exist and visible on screen or not and take screen shot of window like -

     

    If  objType.Exists AND objType.VisibleOnScreen  then

     

       Call Log.Picture (Sys.Desktop.Picture, "Your object is present" )', pmNormal, attr)
       If objType.Waitproperty("Enabled",True,5000) Then
        objType.Click
        Else
        Log.error objType& " objType is not Enabled" 
       End IF
       Else
          Log.error objType& " objType is not found" 

          Call Log.Picture (Sys.Desktop.Picture, "Your object is not present" )', pmNormal, attr)
         
      End If

     

    This may help you :)