diff --git a/java/client/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java b/java/client/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java index 341eaeaf72c85..374627842bca2 100644 --- a/java/client/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java +++ b/java/client/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java @@ -70,6 +70,7 @@ import com.google.common.collect.ImmutableMap; import com.google.common.io.Resources; +import org.openqa.selenium.InvalidSelectorException; import org.openqa.selenium.WebDriverException; import org.openqa.selenium.interactions.Interaction; import org.openqa.selenium.interactions.KeyInput; @@ -187,6 +188,9 @@ public W3CHttpCommandCodec() { switch (using) { case "class name": + if (value.matches(".*\\s.*")) { + throw new InvalidSelectorException("Compound class names not permitted"); + } toReturn.put("using", "css selector"); toReturn.put("value", "." + cssEscape(value)); break; diff --git a/java/client/test/org/openqa/selenium/ElementFindingTest.java b/java/client/test/org/openqa/selenium/ElementFindingTest.java index 4a3345b1e29a8..3542355f5c7c6 100644 --- a/java/client/test/org/openqa/selenium/ElementFindingTest.java +++ b/java/client/test/org/openqa/selenium/ElementFindingTest.java @@ -347,9 +347,6 @@ public void testFindingASingleElementByCompoundClassNameShouldThrow() { } @Test - @NotYetImplemented(MARIONETTE) - @NotYetImplemented(SAFARI) - @NotYetImplemented(EDGE) public void testFindingMultipleElementsByCompoundClassNameShouldThrow() { driver.get(pages.xhtmlTestPage); assertThatExceptionOfType(NoSuchElementException.class)