Is there any way to temporarily disable screenshots?


#1

Hello guys! In my Katalon project I have to firstly close couple of optional views (like GDPR, permissions, advertisements etc.) and I don’t care if they appear or not, so I use FailureHandling.OPTIONAL to interact with those optional views. The problem is that if such view hasn’t appeared then a report contains screenshots of this step, which makes the reports and Katalon Analytics quite messy and therefore bugs are hard to investigate.
Is there any way to disable taking screenshots at the beginning and enable it at some point of execution? Or is there any way to use methods like Mobile.verifyElementVisible or Mobile.verifyElementExist to make them not taking screenshots?
Any help would be appreciated!


#2

Maybe one idea is to generate a wrapper method and inside that method you put the generic takescreenshot method.
So you call that wrapper method whenever you like in any section of any test. whenever you want that method not to take screenshot any more you can comment or deactivate the method inside the wrapper method. I dont know if that helps ,just an idea. Also you can try to disable this option maybe


#3

Thank you @francorebu, actually it might be possible to disable screenshots globally and take a screenshot in Test Hook when test case has failed :thinking:

edited:
but… I’m not sure how a report would look like, if I will be creating screenshots in that way :thinking: not sure if reports contain screenshots taken “manually”