'Is there a way to disable the `takeScreenshot()` action when an OpenTest test fails?

Sometimes it's useful to do something like loop an AssertElementNotVisible() until the element in question is visible. However, the takeScreenshot() event is quite slow, and each time the test fails until it succeeds, it will take a screenshot. This slows everything down. Is there a way to disable the screenshot taken on test failure?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source