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.

To use the feature, apply the ScreenshotOnFail attribute to your test class.

[TestClass]
[ScreenshotOnFail(true)]
[IOS(Constants.IOSNativeAppPath,
    Constants.IOSDefaultVersion,
    Constants.IOSDefaultDeviceName,
    AppBehavior.RestartEveryTime)]
public class ScreenshotsOnFailTests : IOSTest
{
    [TestMethod]
    public void ButtonClicked_When_CallClickMethod()
    {
        var button = App.ElementCreateService.CreateByName<Button>("ComputeSumButton");

        button.Click();
    }
}

If the test fails, a screenshot is saved in the location you specified in the configuration file.

Learn more

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.

To use the feature, apply VideoRecording attribute to your test class.

[TestClass]
[VideoRecording(VideoRecordingMode.OnlyFail)]
[IOS(Constants.IOSNativeAppPath,
    Constants.IOSDefaultVersion,
    Constants.IOSDefaultDeviceName,
    AppBehavior.RestartEveryTime)]
public class VideoRecordingTests : IOSTest
{
    [TestMethod]
    public void ButtonClicked_When_CallClickMethod()
    {
        var button = App.ElementCreateService.CreateByName<Button>("ComputeSumButton");

        button.Click();
    }
}

Learn more

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.

[TestClass]
[ExecutionTimeUnder(5000, TimeUnit.Milliseconds)]
[IOS(Constants.IOSNativeAppPath,
    Constants.IOSDefaultVersion,
    Constants.IOSDefaultDeviceName,
    AppBehavior.RestartEveryTime)]
public class MeasureTestExecutionTimesTests : IOSTest

Learn more

Try Now Bellatrix

Build up to 100 tests using full product capabilities.

Download