Skip to content

Commit 4f8c792

Browse files
committed
Fixing clicks on invisible elements in HtmlUnitDriver broken by ElementNotVisibleException being a subclass of InvalidElementStateException
1 parent 70083e8 commit 4f8c792

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java/client/src/org/openqa/selenium/htmlunit/HtmlUnitWebElement.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
package org.openqa.selenium.htmlunit;
2020

21+
import com.google.common.base.Throwables;
22+
2123
import org.openqa.selenium.By;
2224
import org.openqa.selenium.Dimension;
2325
import org.openqa.selenium.ElementNotVisibleException;
@@ -136,6 +138,7 @@ public void click() {
136138
try {
137139
verifyCanInteractWithElement();
138140
} catch (InvalidElementStateException e) {
141+
Throwables.propagateIfInstanceOf(e, ElementNotVisibleException.class);
139142
// Swallow disabled element case
140143
// Clicking disabled elements should still be passed through,
141144
// we just don't expect any state change

0 commit comments

Comments
 (0)