Troubleshooting Easiness
With the increasing tests count and complexity, it will be even more critical that the tests are more maintainable. A significant part of this effort is the easier troubleshooting and better support for locating errors. BELLATRIX help you with screenshots and video recording together with detailed log reports and rich test running information.
Screenshot on Test Failure
BELLATRIX automatically creates a screenshot if the test fails.
One of the best ways to detect what was the cause of the test failure is to see a screenshot of the app at that moment.
[TestClass]
[App(Constants.WpfAppPath, Lifecycle.RestartEveryTime)]
public class AppScreenshotsOnFailTests : DesktopTest
{
[TestMethod]
public void MessageChanged_When_ButtonHovered_Wpf()
{
var button = App.ElementCreateService.CreateByName<Button>("button");
button.Hover();
}
}
If the test fails, a screenshot is saved in the location you specified in the configuration file.
Video on Test Failure
BELLATRIX automatically saves a video recording if the test fails.
Another great way to see what was the cause of test failure is to watch a video of the whole test execution.
[TestClass]
[App(Constants.WpfAppPath, Lifecycle.RestartEveryTime)]
public class VideoRecordingTests : DesktopTest
{
[TestMethod]
public void MessageChanged_When_ButtonHovered_Wpf()
{
var button = App.ElementCreateService.CreateByName<Button>("button");
button.Hover();
}
}
Measure Test Execution Times
Sometimes it is useful to use your functional tests to measure performance or just to make sure that your app is not slow. To do this, BELLATRIX libraries offer the ExecutionTimeUnder attribute whereby you specify a timeout. If the test is executed over it, the test fails.
[ExecutionTimeUnder(2)]
public class MeasuredResponseTimesTests : DesktopTest