htmlunit-driver icon indicating copy to clipboard operation
htmlunit-driver copied to clipboard

UnsupportedOperationException when using advanced user interactions on wrapped HtmlUnitDriver

Open barancev opened this issue 7 years ago • 0 comments

@lklonowski commented on Mon Nov 27 2017

Meta -

OS: Windows 7 Selenium Version: 3.7.1 Browser: HtmlUnit Browser Version: 2.28.2

Expected Behavior -

when wrapping an HtmlUnitDriver inside an EventFiringWebDriver, advanced user interactions can be performed without exceptions

Actual Behavior -

an UnsupportedOperationException is thrown every time

EventFiringWebDriver throws this Exception, because the HtmlUnitDriver does not implement the Interactive interface; the BuildAction only catches UnsupportedCommandExceptions and therefore doesn't use the fallback option => is this meant to work this way and how do I cope with this?

Steps to reproduce -

  • wrapping an HtmlUnitDriver inside an EventFiringWebDriver
  • performing advanced user interactions
HtmlUnitDriver htmlUnitDriver = new HtmlUnitDriver();
WebDriver driver = new EventFiringWebDriver(htmlUnitDriver);

Actions builder = new Actions(driver);
builder.doubleClick().perform();

@barancev commented on Mon Nov 27 2017

Yes, HtmlUnitDriver should implement Interactive interface.

barancev avatar Nov 27 '17 15:11 barancev