Ask a Question

TestComplete - Any way to Post an Image on Error at the script level and not the project level?

Jaime
Occasional Contributor

TestComplete - Any way to Post an Image on Error at the script level and not the project level?

TestComplete - Any way to Post an Image on Error at the script level and not the project level?

 

I have a project full of scripts, but some, I cannot grab images due to sensitive data, but others scripts that are not sensitive and in the same project, I want to grab images on errors.  Can TestComplete handle this scenario, and if so, how?

 

Thank you!!

Jaime

6 REPLIES 6
Marsha_R
Community Hero

You can create your own event handler and only use it where the images are not sensitive.

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/handling-events/creating-handl...


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Jaime
Occasional Contributor

Hi Marsha_R!

 

Thank you - although, I am now able to generate an event that grabs a screenshot on Log.Error. But I can't seem to find how to make an event only apply to tagged tests... Any ideas?

 

Thank you so much!!!

 

Jaime

Jaime
Occasional Contributor

Playing around with code...

 


function EventControl1_OnLogError(Sender, LogParams)
{
If (@functional.Exists){
Log.Picture(Sys.Desktop.Picture(), "Capture Image on Failure", "", pmHighest);
}
}

 

//  Seems to not recognize the tag of @functional.  Ideas? Thanks!!!

A tag is more like a label than an object.  It doesn't have properties like Exists.

 

https://support.smartbear.com/testcomplete/docs/scripting/tags.html


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Jaime
Occasional Contributor

Thanks Marsha...

 

Any ideas on how to turn on post images just on one script (non-keyword, but a javascript unit instead)?

 

Thx!

Jaime

If it's in one unit, then how about Try/Catch?

https://support.smartbear.com/testcomplete/docs/scripting/handling-exceptions.html


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: