Skip to content

Commit

Permalink
[java] Simplifying a test, there is no need to catch an exception to …
Browse files Browse the repository at this point in the history
…immediately fail on it, let junit do its job
  • Loading branch information
barancev committed Apr 19, 2020
1 parent 64ccc9e commit c204501
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions java/client/test/org/openqa/selenium/ClickTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import static org.openqa.selenium.testing.drivers.Browser.MARIONETTE;
import static org.openqa.selenium.testing.drivers.Browser.SAFARI;

import com.google.common.base.Throwables;

import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
Expand Down Expand Up @@ -369,13 +367,6 @@ public void testShouldBeAbleToClickOnAPartiallyOverlappedLinkThatWrapsToTheNextL
public void clickingOnADisabledElementIsANoOp() {
driver.get(appServer.whereIs("click_tests/disabled_element.html"));

WebElement element = driver.findElement(By.name("disabled"));

try {
element.click();
// A failing implementation will throw an exception
} catch (WebDriverException e) {
fail("The click should have been a no-op.\n" + Throwables.getStackTraceAsString(e));
}
driver.findElement(By.name("disabled")).click(); // Should not throw
}
}

0 comments on commit c204501

Please sign in to comment.