diff --git a/java/src/org/openqa/selenium/remote/RemoteWebDriver.java b/java/src/org/openqa/selenium/remote/RemoteWebDriver.java index 0148ff5da35b0..517bd3554089d 100644 --- a/java/src/org/openqa/selenium/remote/RemoteWebDriver.java +++ b/java/src/org/openqa/selenium/remote/RemoteWebDriver.java @@ -472,9 +472,6 @@ public Object executeScript(String script, Object... args) { "You must be using an underlying instance of WebDriver that supports executing javascript"); } - // Escape the quote marks - script = script.replaceAll("\"", "\\\""); - List convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect( Collectors.toList()); @@ -488,9 +485,6 @@ public Object executeAsyncScript(String script, Object... args) { "WebDriver that supports executing javascript"); } - // Escape the quote marks - script = script.replaceAll("\"", "\\\""); - List convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect( Collectors.toList()); diff --git a/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java b/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java index 7f60dba947ff6..d1e6e9f66abb3 100644 --- a/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java +++ b/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java @@ -351,9 +351,6 @@ private List stringToUtf8Array(String toConvert) { } private Map toScript(String script, Object... args) { - // Escape the quote marks - script = script.replaceAll("\"", "\\\""); - List convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect( Collectors.toList());