cancel
Showing results for 
Search instead for 
Did you mean: 

Attach printscreen to Log.Checkpoint

SOLVED
Highlighted
Occasional Contributor

Attach printscreen to Log.Checkpoint

The only way I can post a printscreen of the entire screen is this way:
Log.Picture(Sys.Desktop.Picture(), "OK Message");

 

Reading the documentation of Checkpoint method (https://support.smartbear.com/testcomplete/docs/reference/project-objects/test-log/log/checkpoint.ht...), I try this:

Log.Checkpoint("OK Message",Sys.Desktop.Picture()), but nothing show in the Tab Picture

what is the correct way to take a screenshot of the screen to put in the Log.Checkpoint () method?



1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: Attach printscreen to Log.Checkpoint

I already try this, but get the error: Unexpected Token ,

unexpected token.png

 

I confused, I thought the method would be able to detect the type of the object, because besides the one you commented on, I tried to pass blank strings and get runtime error. I didn't notice the other default values ​​on the right side of the table.

 

Log.Checkpoint("OK Message","","","",Sys.Desktop.Picture()) -- get JavaScript runtime error.

 

I solved using null, and only the priority need the parameter: pmNormal or any integer and the picture object or method which return a picture object.


Log.Checkpoint("OK Message",null,pmNormal,null,Aliases.myApp.Picture())

Log.Checkpoint(null,null,pmNormal,null,Aliases.myApp.Picture())

 

 

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Re: Attach printscreen to Log.Checkpoint

Try something like   Log.Checkpoint("OK Message",,,Sys.Desktop.Picture())

 

The picture needs to be the number 5 parameter

Highlighted
Staff

Re: Attach printscreen to Log.Checkpoint

just out of curiosity, would you mind explaining the use case of capturing the entire desktop as a picture within your logs?

Best,
Justin Kim
Highlighted
Occasional Contributor

Re: Attach printscreen to Log.Checkpoint

I already try this, but get the error: Unexpected Token ,

unexpected token.png

 

I confused, I thought the method would be able to detect the type of the object, because besides the one you commented on, I tried to pass blank strings and get runtime error. I didn't notice the other default values ​​on the right side of the table.

 

Log.Checkpoint("OK Message","","","",Sys.Desktop.Picture()) -- get JavaScript runtime error.

 

I solved using null, and only the priority need the parameter: pmNormal or any integer and the picture object or method which return a picture object.


Log.Checkpoint("OK Message",null,pmNormal,null,Aliases.myApp.Picture())

Log.Checkpoint(null,null,pmNormal,null,Aliases.myApp.Picture())

 

 

View solution in original post

Highlighted
Occasional Contributor

Re: Attach printscreen to Log.Checkpoint

For those who copy the code and paste it in the testcomplete do not need to change the last parameter to Aliases.<application name>.Picture()

Highlighted
Community Hero

Re: Attach printscreen to Log.Checkpoint

@joaobc Glad you found your answer!

 

It's been my experience in the languages I've used that if there is a list of parameters, then you have to enter something for each of them up to and including the one you need.  After that you can leave them off.  Detecting the type of object rather than just looking at the position would be more complicated and in some cases useless (say if all parameters are strings, which string did you just find?).   

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors