Forum Discussion

douglasrs89's avatar
douglasrs89
New Contributor
10 years ago

Log.Picture don't take the correct picture before Runner.Stop(true)

I have one event but the action Log.Picture don't take the correct picture on the screen.





procedure GeneralEvents_OnLogError(Sender; LogParams);


var 


  autcom: OleVariant;


begin


  Log.Picture(Sys.Desktop, '', '', pmHighest);


  autcom := Sys.Process('autcom');


  if autcom.Exists then


  begin


    while autcom.Exists do


    begin


      try


       Sys.Process('autcom').Terminate;


      except


       Delay(1000);     


      end;


    end;


  end;


  FB_LoginAutcom;


  Runner.Stop(true);


end;




If i change to




procedure GeneralEvents_OnLogError(Sender; LogParams);


var 


  autcom: OleVariant;


begin


  Log.Picture(Sys.Desktop, '', '', pmHighest);

  Runner.Stop(true);


  autcom := Sys.Process('autcom');


  if autcom.Exists then


  begin


    while autcom.Exists do


    begin


      try


       Sys.Process('autcom').Terminate;


      except


       Delay(1000);     


      end;


    end;


  end;


  FB_LoginAutcom;


end;



He takes the correct picture but stop the event on Runner.Stop



If i dont use Log.Picture the TestComplete take own screen picture

1 Reply

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Douglas,

     


    Judging by your code, you are making a picture of the whole desktop in both samples. Could you please post the actual and desired pictures here?


    Also, please check if the same issue persists in TestComplete 10.40 which was recently released.