test_class.declarator: driver
test_class.original_string: WebDriver driver;
test_class.type: WebDriver
test_class.var_name: driver
test_class.declarator: browser
test_class.original_string: InBrowser browser;
test_class.type: InBrowser
test_class.var_name: browser
test_class.declarator: webel
test_class.original_string: WebElement webel;
test_class.type: WebElement
test_class.var_name: webel
test_class.file: jdollarx/src/test/java/com/github/loyada/jdollarx/OperationsTest.java
test_class.identifier: OperationsTest
test_case.body: @Test
      public void clickWithRetriesFailure() throws Exception {
          when(browser.clickOn(any())).thenThrow(Exception.class).thenThrow(IOException.class).thenThrow(NoSuchElementException.class);
          try {
              Operations.doWithRetries(() -> browser.clickOn(div), 3, 10);
          } catch ( NoSuchElementException e) {
              verify(browser, times(3)).clickOn(div);
              return;
          }
          fail("expected to throw NoSuchElementException");
      }
test_case.class_method_signature: OperationsTest.clickWithRetriesFailure()
test_case.full_signature: @Test public void clickWithRetriesFailure()
test_case.identifier: clickWithRetriesFailure
test_case.invocations: thenThrow thenThrow thenThrow when clickOn any doWithRetries clickOn clickOn verify times fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void clickWithRetriesFailure()
focal_class.file: jdollarx/src/main/java/com/github/loyada/jdollarx/Operations.java
focal_class.identifier: Operations
focal_class.class_method_signature: Operations.doWithRetries(
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )
focal_class.full_signature: public static void doWithRetries(
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )
focal_class.identifier: doWithRetries
focal_class.modifiers: public static
focal_class.parameters: (
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )
focal_class.return: void
focal_class.signature: void doWithRetries(
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )
focal_class.class_method_signature: Operations.doWithRetries(
              Callable<T> action,
              int numberOfRetries,
              int sleepInMillisec
      )
focal_class.full_signature: public static T doWithRetries(
              Callable<T> action,
              int numberOfRetries,
              int sleepInMillisec
      )
focal_class.identifier: doWithRetries
focal_class.modifiers: public static
focal_class.parameters: (
              Callable<T> action,
              int numberOfRetries,
              int sleepInMillisec
      )
focal_class.return: T
focal_class.signature: T doWithRetries(
              Callable<T> action,
              int numberOfRetries,
              int sleepInMillisec
      )
focal_class.class_method_signature: Operations.preformActions(WebDriver driver, UnaryOperator<Actions> func)
focal_class.full_signature: private static void preformActions(WebDriver driver, UnaryOperator<Actions> func)
focal_class.identifier: preformActions
focal_class.modifiers: private static
focal_class.parameters: (WebDriver driver, UnaryOperator<Actions> func)
focal_class.return: void
focal_class.signature: void preformActions(WebDriver driver, UnaryOperator<Actions> func)
focal_method.body: public static  void doWithRetries(
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              ){
              int triesLeft = numberOfRetries;
              while (true) {
                  try {
                      action.run();
                      return;
                  } catch (Exception|AssertionError e) {
                      triesLeft-=1;
                      if (triesLeft<=0) {
                          throw e;
                      }
                      try {
                          sleep(sleepInMillisec);
                      } catch (InterruptedException intEx) {
                          throw new RuntimeException(intEx);
                      }
                  }
          }
      }
focal_method.class_method_signature: Operations.doWithRetries(
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )
focal_method.full_signature: public static void doWithRetries(
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )
focal_method.identifier: doWithRetries
focal_method.invocations: run sleep
focal_method.modifiers: public static
focal_method.parameters: (
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )
focal_method.return: void
focal_method.signature: void doWithRetries(
              Runnable action,
              int numberOfRetries,
              int sleepInMillisec
              )