diff --git a/java/client/src/org/openqa/selenium/interactions/KeyInput.java b/java/client/src/org/openqa/selenium/interactions/KeyInput.java index b2fadbf951943..2e2ecd9ca85ea 100644 --- a/java/client/src/org/openqa/selenium/interactions/KeyInput.java +++ b/java/client/src/org/openqa/selenium/interactions/KeyInput.java @@ -50,7 +50,7 @@ public Interaction createKeyUp(int codePoint) { public Map encode() { Map toReturn = new HashMap<>(); - toReturn.put("type", "key"); + toReturn.put("type", getInputType().getType()); toReturn.put("id", name); return toReturn; diff --git a/java/client/src/org/openqa/selenium/interactions/PointerInput.java b/java/client/src/org/openqa/selenium/interactions/PointerInput.java index f5c99236a466d..62cdf32a9c6c8 100644 --- a/java/client/src/org/openqa/selenium/interactions/PointerInput.java +++ b/java/client/src/org/openqa/selenium/interactions/PointerInput.java @@ -51,7 +51,7 @@ public SourceType getInputType() { public Map encode() { Map toReturn = new HashMap<>(); - toReturn.put("type", "pointer"); + toReturn.put("type", getInputType().getType()); toReturn.put("id", name); Map parameters = new HashMap<>(); diff --git a/java/client/src/org/openqa/selenium/interactions/SourceType.java b/java/client/src/org/openqa/selenium/interactions/SourceType.java index 940065ca8ebba..46fd2026a981e 100644 --- a/java/client/src/org/openqa/selenium/interactions/SourceType.java +++ b/java/client/src/org/openqa/selenium/interactions/SourceType.java @@ -21,7 +21,17 @@ * One of the allowing types for an {@link InputSource}. */ public enum SourceType { - KEY, - NONE, - POINTER, + KEY("key"), + NONE(null), + POINTER("pointer"); + + private final String type; + + SourceType(String type) { + this.type = type; + } + + public String getType() { + return type; + } }