@Test
public void properlyHandlesInterruptedExceptionBetweenRetries() throws IOException, URISyntaxException, InterruptedException {

    ActionExecutor webDriverActionExecutionBase = getWebDriverActionExecutionBase(10);
    Iterator<WebDriverAction> webDriverActionIterator = mock(Iterator.class);
    TestScenarioActions testScenarioSteps = mock(TestScenarioActions.class);
    when(testScenarioSteps.iterator()).thenReturn(webDriverActionIterator);
    TestScenario testScenario = mock(TestScenario.class);
    when(testScenario.steps()).thenReturn(testScenarioSteps);
    WebDriverAction firstAction = mock(WebDriverAction.class);
    doThrow(new WebDriverException("Something happened!")).when(firstAction).execute(any(), any(), any());
    when(webDriverActionIterator.hasNext()).thenReturn(true, false);
    when(firstAction.expectsHttpRequest()).thenReturn(true);
    PowerMockito.mockStatic(Thread.class);
    PowerMockito.doThrow(new InterruptedException()).when(Thread.class);
    Thread.sleep(anyLong());
    when(webDriverActionIterator.next()).thenReturn(firstAction);
    ExecutionReport report = webDriverActionExecutionBase.execute(testScenario);
    assertEquals(AutomationResult.INTERRUPTED, report.getAutomationResult());
}