From 1307d3a4020db578f15ea02a8d39059ec4b388f4 Mon Sep 17 00:00:00 2001 From: Alexei Barantsev Date: Fri, 14 Jun 2019 14:43:49 +0300 Subject: [PATCH] [java] Fixing compound class name handling --- .../openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java | 4 ++++ java/client/test/org/openqa/selenium/ElementFindingTest.java | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) 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)