Adding new Interactive interface to EventFiringWebDriver. Fixes
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.HasInputDevices;
import org.openqa.selenium.interactions.HasTouchScreen;
+import org.openqa.selenium.interactions.Interactive;
import org.openqa.selenium.interactions.Keyboard;
import org.openqa.selenium.interactions.Mouse;
+import org.openqa.selenium.interactions.Sequence;
import org.openqa.selenium.interactions.TouchScreen;
import org.openqa.selenium.interactions.internal.Coordinates;
import org.openqa.selenium.interactions.internal.Locatable;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
* {@link WebDriverEventListener}, e&#46;g&#46; for logging purposes.
*/
public class EventFiringWebDriver implements WebDriver, JavascriptExecutor, TakesScreenshot,
- WrapsDriver, HasInputDevices, HasTouchScreen {
+ WrapsDriver, HasInputDevices, HasTouchScreen,
+ Interactive {
private final WebDriver driver;
@@ -332,6 +336,28 @@ public TouchScreen getTouch() {
+ " user interactions yet.");
}
+ @Override
+ public void perform(Collection<Sequence> actions) {
+ if (driver instanceof Interactive) {
+ ((Interactive) driver).perform(actions);
+ return;
+ }
+ throw new UnsupportedOperationException("Underlying driver does not implement advanced"
+ + " user interactions yet.");
+
+ }
+
+ @Override
+ public void resetInputState() {
+ if (driver instanceof Interactive) {
+ ((Interactive) driver).resetInputState();
+ return;
+ }
+ throw new UnsupportedOperationException("Underlying driver does not implement advanced"
+ + " user interactions yet.");
+
+ }
+
private class EventFiringWebElement implements WebElement, WrapsElement, WrapsDriver, Locatable {
private final WebElement element;
