@Test
public void cleansUpEvenIfExceptionIsThrown() throws IOException, URISyntaxException {

    String exceptionMessage = "Browser could not be created";
    when(replayBrowserProvider.get()).thenThrow(new IOException(exceptionMessage));
    TestScenarioSteps steps = new TestScenarioSteps();
    when(stepsProvider.get()).thenReturn(steps);
    when(executionReport.getAutomationResult()).thenReturn(AutomationResult.COULD_NOT_CREATE_DRIVER);
    VirtualScreenProcessCreator virtualScreenProcessCreator = mock(VirtualScreenProcessCreator.class);
    Integer screenNumber = 1;
    Process process = mock(Process.class);
    when(virtualScreenProcessCreator.createXvfbProcess(screenNumber)).thenReturn(process);
    ReplayCommand replayCommand = new ReplayCommand(replayBrowserProvider, stepsProvider,
            virtualScreenProcessCreator, screenNumber, measurementsFile, harFile);
    replayCommand.run();
}