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

    int maxRetries = 3;
    ActionExecutor webDriverActionExecutionBase = getWebDriverActionExecutionBase(10, maxRetries);
    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);
    when(webDriverActionIterator.hasNext()).thenReturn(true, false);
    WebDriverAction firstAction = mock(WebDriverAction.class);
    doThrow(new WebDriverException("Exception occured!")).when(firstAction).execute(any(), any(), any());
    when(webDriverActionIterator.next()).thenReturn(firstAction);
    ExecutionReport report = webDriverActionExecutionBase.execute(testScenario);
    assertEquals(AutomationResult.TIMEOUT, report.getAutomationResult());
    verify(firstAction, times(maxRetries)).execute(any(), any(), any());
}