title: Cucumber / JUnit - How to proceed when test failed inside a loop?
body: <p>Good evening,</p>
  
  <p>I investigated hours to find a solution for the following problem:
  I'm using Eclipse, Cucumber, JUnit &amp; Maven. 
  How is it possible to get a single test step will be marked as failed. It has been possible for me to fail the whole Scenario with try-catch and Assert.fail(), but not one case inside a loop. </p>
  
  <p>Attached a part of my code: </p>
  
  <p>Scenario:
  Then Execute Login on page
  |455xxxxxx10|4xx0|
  |455xxxxxx10|4xx0|
  |455xxxxxx10|4xx0|
  |455xxxxxx10|4xx0|
  |455xxxxxx10|4xx0|</p>
  
  <p>It's quite possible that one number is wrong and then the whole scenario will be failed? It would be great to mark this single case as error and execute the loop again. </p>
  
  <pre><code>        List&lt;String&gt; credentials = dataTable.asList(String.class);
          driver.get("URL");
          sessionID = driver.manage().getCookieNamed("CookieName").toString();
  
          for (int a=0, b=1; a&lt;credentials.size() &amp; b&lt;=credentials.size(); a+=2, b+=2)
          {
              driver.findElement(By.linkText("LOGIN")).click();
              wait = new WebDriverWait(driver, 60);
              wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("/html/body/div[1]/header/nav/div/div/div/ul/li[2]/a/span")));```
  
  </code></pre>