Forum Discussion

Dewayne_Pinion's avatar
Dewayne_Pinion
Contributor
10 years ago

Logging a picture that captures a mouse click

Hello all,

Is there a way during playback that I can tell testcomplete to capture a mouse click and have it create a picture of that mouse click to the log?

 

Thanks

3 Replies

  • Ryan_Moran's avatar
    Ryan_Moran
    Valued Contributor

    The "Test Visualizer" under project settings does this when enabled.

    Additionally you can take an image of a specific object, immediately after clicking, like so:

     

    //JScript
    var wshell = new ActiveXObject('WScript.Shell');
    wshell.run("notepad");
    var object = Sys.Process("notepad").WaitWindow("Notepad", "Untitled*", 1, 10000);
    object.click();
    Log.Picture(object, "Example of capturing an image.");

     

    • Dewayne_Pinion's avatar
      Dewayne_Pinion
      Contributor

      Thanks Ryan,

      I should have been more specific. The item I am clicking on is on a pop up form, that disappears when clicked. So I cannot perform an image capture after the click occurs since the control will not be visible. Is there a way to have testcomplete create the log picture as the button is being clicked?

       

      Thanks

      • Ryan_Moran's avatar
        Ryan_Moran
        Valued Contributor

        Aside from either using the Test Visualizer, or moving the mouse, taking the image, and then actually clicking...

        I don't believe so. It sounds as though you could just take the image prior to clicking though unless I'm misunderstanding you.