Skip to content

Commit 2e6f348

Browse files
committed
[grid] Remove translating locator calls from non-W3C compliant clients to W3C compliant locators
Fixes #11470
1 parent 81a3471 commit 2e6f348

File tree

6 files changed

+0
-133
lines changed

6 files changed

+0
-133
lines changed

java/src/org/openqa/selenium/grid/node/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ java_library(
1616
"//java/src/org/openqa/selenium/grid/component",
1717
"//java/src/org/openqa/selenium/grid/data",
1818
"//java/src/org/openqa/selenium/grid/jmx",
19-
"//java/src/org/openqa/selenium/grid/node/locators",
2019
"//java/src/org/openqa/selenium/grid/security",
2120
"//java/src/org/openqa/selenium/grid/web",
2221
"//java/src/org/openqa/selenium/json",

java/src/org/openqa/selenium/grid/node/locators/BUILD.bazel

-16
This file was deleted.

java/src/org/openqa/selenium/grid/node/locators/ById.java

-43
This file was deleted.

java/src/org/openqa/selenium/grid/node/locators/ByName.java

-42
This file was deleted.

java/test/org/openqa/selenium/grid/node/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ java_test_suite(
1515
"//java/src/org/openqa/selenium/grid/data",
1616
"//java/src/org/openqa/selenium/grid/node",
1717
"//java/src/org/openqa/selenium/grid/node/local",
18-
"//java/src/org/openqa/selenium/grid/node/locators",
1918
"//java/src/org/openqa/selenium/grid/node/remote",
2019
"//java/src/org/openqa/selenium/grid/security",
2120
"//java/src/org/openqa/selenium/grid/web",

java/test/org/openqa/selenium/grid/node/CustomLocatorHandlerTest.java

-30
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.openqa.selenium.events.local.GuavaEventBus;
3636
import org.openqa.selenium.grid.data.Session;
3737
import org.openqa.selenium.grid.node.local.LocalNode;
38-
import org.openqa.selenium.grid.node.locators.ById;
3938
import org.openqa.selenium.grid.security.Secret;
4039
import org.openqa.selenium.grid.testing.TestSessionFactory;
4140
import org.openqa.selenium.grid.web.Values;
@@ -249,35 +248,6 @@ public By createBy(Object usingParameter) {
249248
assertThat(seenId).isEqualTo(elementId);
250249
}
251250

252-
@Test
253-
void shouldFallbackToUseById() {
254-
String elementId = UUID.randomUUID().toString();
255-
256-
Node node = Mockito.mock(Node.class);
257-
when(node.executeWebDriverCommand(argThat(matchesUri("/session/{sessionId}/elements"))))
258-
.thenReturn(
259-
new HttpResponse()
260-
.addHeader("Content-Type", Json.JSON_UTF_8)
261-
.setContent(Contents.asJson(singletonMap(
262-
"value", singletonList(singletonMap(Dialect.W3C.getEncodedElementKey(), elementId))))));
263-
264-
HttpHandler handler = new CustomLocatorHandler(
265-
node,
266-
registrationSecret,
267-
singleton(new ById()));
268-
269-
HttpResponse res = handler.execute(
270-
new HttpRequest(POST, "/session/1234/elements")
271-
.setContent(Contents.asJson(ImmutableMap.of(
272-
"using", "id",
273-
"value", "tasty"))));
274-
275-
List<Map<String, Object>> elements = Values.get(res, new TypeToken<List<Map<String, Object>>>(){}.getType());
276-
assertThat(elements).hasSize(1);
277-
Object seenId = elements.get(0).get(Dialect.W3C.getEncodedElementKey());
278-
assertThat(seenId).isEqualTo(elementId);
279-
}
280-
281251
private ArgumentMatcher<HttpRequest> matchesUri(String template) {
282252
UrlTemplate ut = new UrlTemplate(template);
283253

0 commit comments

Comments
 (0)