Skip to content

Commit 9e759b4

Browse files
authored
fix: Bump minimum required Selenium version to 4.4.0 (#1738)
1 parent 967f099 commit 9e759b4

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ signing.secretKeyRingFile=PathToYourKeyRingFile
77
ossrhUsername=your-jira-id
88
ossrhPassword=your-jira-password
99

10-
selenium.version=4.2.1
10+
selenium.version=4.4.0

src/main/java/io/appium/java_client/remote/AppiumW3CHttpCommandCodec.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,13 @@
2222
import static org.openqa.selenium.remote.DriverCommand.GET_ELEMENT_SIZE;
2323
import static org.openqa.selenium.remote.DriverCommand.GET_PAGE_SOURCE;
2424
import static org.openqa.selenium.remote.DriverCommand.IS_ELEMENT_DISPLAYED;
25-
import static org.openqa.selenium.remote.DriverCommand.SEND_KEYS_TO_ACTIVE_ELEMENT;
2625
import static org.openqa.selenium.remote.DriverCommand.SEND_KEYS_TO_ELEMENT;
2726
import static org.openqa.selenium.remote.DriverCommand.SET_TIMEOUT;
2827
import static org.openqa.selenium.remote.DriverCommand.SUBMIT_ELEMENT;
2928

30-
import com.google.common.collect.ImmutableList;
31-
import com.google.common.collect.ImmutableMap;
32-
33-
import org.openqa.selenium.interactions.KeyInput;
34-
import org.openqa.selenium.interactions.Sequence;
3529
import org.openqa.selenium.remote.codec.w3c.W3CHttpCommandCodec;
3630

37-
import java.util.Collection;
3831
import java.util.Map;
39-
import java.util.stream.Collectors;
40-
import java.util.stream.Stream;
4132

4233
public class AppiumW3CHttpCommandCodec extends W3CHttpCommandCodec {
4334
/**
@@ -51,7 +42,6 @@ public AppiumW3CHttpCommandCodec() {
5142
defineCommand(GET_ELEMENT_ATTRIBUTE, get("/session/:sessionId/element/:id/attribute/:name"));
5243
defineCommand(IS_ELEMENT_DISPLAYED, get("/session/:sessionId/element/:id/displayed"));
5344
defineCommand(GET_PAGE_SOURCE, get("/session/:sessionId/source"));
54-
defineCommand(SEND_KEYS_TO_ACTIVE_ELEMENT, post("/session/:sessionId/actions"));
5545
}
5646

5747
@Override
@@ -76,23 +66,6 @@ public void alias(String commandName, String isAnAliasFor) {
7666
protected Map<String, ?> amendParameters(String name, Map<String, ?> parameters) {
7767
// This blocks parent constructor from undesirable parameters amending
7868
switch (name) {
79-
case SEND_KEYS_TO_ACTIVE_ELEMENT:
80-
Object rawValue = parameters.get("value");
81-
//noinspection unchecked
82-
Stream<CharSequence> source = (rawValue instanceof Collection)
83-
? ((Collection<CharSequence>) rawValue).stream()
84-
: Stream.of((CharSequence[]) rawValue);
85-
String text = source.collect(Collectors.joining());
86-
87-
final KeyInput keyboard = new KeyInput("keyboard");
88-
Sequence sequence = new Sequence(keyboard, 0);
89-
for (int i = 0; i < text.length(); ++i) {
90-
sequence.addAction(keyboard.createKeyDown(text.charAt(i)))
91-
.addAction(keyboard.createKeyUp(text.charAt(i)));
92-
}
93-
return ImmutableMap.<String, Object>builder()
94-
.put("actions", ImmutableList.of(sequence.toJson()))
95-
.build();
9669
case SEND_KEYS_TO_ELEMENT:
9770
case SET_TIMEOUT:
9871
return super.amendParameters(name, parameters);

0 commit comments

Comments
 (0)