Skip to content

Commit b2de541

Browse files
authored
feat: Upgrade to selenium 4.35.0 (#2327)
BREAKING CHANGE: Removed all deprecated methods with Selenium's Location and LocationContext (these classes have been removed in Selenium 4.35.0)
1 parent 75ee094 commit b2de541

File tree

8 files changed

+8
-78
lines changed

8 files changed

+8
-78
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ dependencies {
9595
### Compatibility Matrix
9696
Appium Java Client | Selenium client
9797
----------------------------------------------------------------------------------------------------|-----------------------------
98+
`10.0.0` | `4.35.0`
9899
`9.5.0` | `4.34.0`
99100
`9.4.0` | `4.26.0`, `4.27.0`, `4.28.0`, `4.28.1`, `4.29.0`, `4.30.0`, `4.31.0`, `4.32.0`, `4.33.0`
100101
`9.2.1`(known issues: appium/java-client#2145, appium/java-client#2146), `9.2.2`, `9.2.3`, `9.3.0` | `4.19.0`, `4.19.1`, `4.20.0`, `4.21.0`, `4.22.0`, `4.23.0`, `4.23.1`, `4.24.0`, `4.25.0`, `4.26.0`, `4.27.0`

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jreleaser {
188188
}
189189

190190
wrapper {
191-
gradleVersion = '8.14'
191+
gradleVersion = '8.14.3'
192192
distributionType = Wrapper.DistributionType.ALL
193193
}
194194

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
org.gradle.daemon=true
22

3-
selenium.version=4.34.0
3+
selenium.version=4.35.0
44
# Please increment the value in a release
55
appiumClient.version=9.5.0

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/io/appium/java_client/AppiumDriver.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.openqa.selenium.remote.RemoteWebDriver;
4545
import org.openqa.selenium.remote.Response;
4646
import org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec;
47-
import org.openqa.selenium.remote.html5.RemoteLocationContext;
4847
import org.openqa.selenium.remote.http.HttpClient;
4948
import org.openqa.selenium.remote.http.HttpMethod;
5049

@@ -81,8 +80,6 @@ public class AppiumDriver extends RemoteWebDriver implements
8180
// frequently used command parameters
8281
@Getter
8382
private final URL remoteAddress;
84-
@Deprecated(forRemoval = true)
85-
protected final RemoteLocationContext locationContext;
8683
private final ExecuteMethod executeMethod;
8784
private final Set<String> absentExtensionNames = new HashSet<>();
8885
private URI biDiUri;
@@ -100,7 +97,6 @@ public class AppiumDriver extends RemoteWebDriver implements
10097
public AppiumDriver(HttpCommandExecutor executor, Capabilities capabilities) {
10198
super(executor, capabilities);
10299
this.executeMethod = new AppiumExecutionMethod(this);
103-
locationContext = new RemoteLocationContext(executeMethod);
104100
super.setErrorHandler(ERROR_HANDLER);
105101
this.remoteAddress = executor.getAddressOfRemoteServer();
106102
}
@@ -176,7 +172,6 @@ public AppiumDriver(URL remoteSessionAddress, String platformName, String automa
176172
executor.setResponseCodec(new W3CHttpResponseCodec());
177173
setCommandExecutor(executor);
178174
this.executeMethod = new AppiumExecutionMethod(this);
179-
this.locationContext = new RemoteLocationContext(executeMethod);
180175
super.setErrorHandler(ERROR_HANDLER);
181176
this.remoteAddress = executor.getAddressOfRemoteServer();
182177

src/main/java/io/appium/java_client/android/AndroidDriver.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import org.openqa.selenium.Capabilities;
4444
import org.openqa.selenium.Platform;
4545
import org.openqa.selenium.remote.HttpCommandExecutor;
46-
import org.openqa.selenium.remote.html5.RemoteLocationContext;
4746
import org.openqa.selenium.remote.http.ClientConfig;
4847
import org.openqa.selenium.remote.http.HttpClient;
4948

@@ -251,20 +250,6 @@ public AndroidBatteryInfo getBatteryInfo() {
251250
return new AndroidBatteryInfo(CommandExecutionHelper.executeScript(this, "mobile: batteryInfo"));
252251
}
253252

254-
/**
255-
* Provides the location context.
256-
*
257-
* @return instance of {@link RemoteLocationContext}
258-
* @deprecated This method, {@link org.openqa.selenium.html5.LocationContext} and {@link RemoteLocationContext}
259-
* interface are deprecated, use {@link #getLocation()} and
260-
* {@link #setLocation(io.appium.java_client.Location)} instead.
261-
*/
262-
@Override
263-
@Deprecated(forRemoval = true)
264-
public RemoteLocationContext getLocationContext() {
265-
return locationContext;
266-
}
267-
268253
@Override
269254
public synchronized StringWebSocketClient getLogcatClient() {
270255
if (logcatClient == null) {

src/main/java/io/appium/java_client/ios/IOSDriver.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.openqa.selenium.remote.DriverCommand;
4545
import org.openqa.selenium.remote.HttpCommandExecutor;
4646
import org.openqa.selenium.remote.Response;
47-
import org.openqa.selenium.remote.html5.RemoteLocationContext;
4847
import org.openqa.selenium.remote.http.ClientConfig;
4948
import org.openqa.selenium.remote.http.HttpClient;
5049

@@ -279,20 +278,6 @@ class IOSAlert implements Alert {
279278

280279
}
281280

282-
/**
283-
* Provides the location context.
284-
*
285-
* @return instance of {@link RemoteLocationContext}
286-
* @deprecated This method, {@link org.openqa.selenium.html5.LocationContext} and {@link RemoteLocationContext}
287-
* interface are deprecated, use {@link #getLocation()} and
288-
* {@link #setLocation(io.appium.java_client.Location)} instead.
289-
*/
290-
@Override
291-
@Deprecated(forRemoval = true)
292-
public RemoteLocationContext getLocationContext() {
293-
return locationContext;
294-
}
295-
296281
@Override
297282
public synchronized StringWebSocketClient getSyslogClient() {
298283
if (syslogClient == null) {

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

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,26 @@
1818

1919
import io.appium.java_client.CommandExecutionHelper;
2020
import io.appium.java_client.ExecutesMethod;
21+
import io.appium.java_client.Location;
2122
import io.appium.java_client.MobileCommand;
2223
import org.openqa.selenium.WebDriver;
2324
import org.openqa.selenium.WebDriverException;
24-
import org.openqa.selenium.html5.Location;
25-
import org.openqa.selenium.html5.LocationContext;
26-
import org.openqa.selenium.remote.html5.RemoteLocationContext;
2725

2826
import java.util.HashMap;
2927
import java.util.Map;
3028
import java.util.Optional;
3129

32-
public interface SupportsLocation extends WebDriver, ExecutesMethod, LocationContext {
33-
34-
/**
35-
* Provides the location context.
36-
*
37-
* @return instance of {@link RemoteLocationContext}
38-
* @deprecated This method, {@link LocationContext} and {@link RemoteLocationContext} interface are deprecated, use
39-
* {@link #getLocation()} and {@link #setLocation(io.appium.java_client.Location)} instead.
40-
*/
41-
@Deprecated(forRemoval = true)
42-
RemoteLocationContext getLocationContext();
43-
44-
/**
45-
* Gets the current device's geolocation coordinates.
46-
*
47-
* @return A {@link Location} containing the location information. Returns null if the location is not available
48-
* @deprecated This method and whole {@link LocationContext} interface are deprecated, use {@link #getLocation()}
49-
* instead.
50-
*/
51-
@Deprecated(forRemoval = true)
52-
default Location location() {
53-
return getLocationContext().location();
54-
}
30+
public interface SupportsLocation extends WebDriver, ExecutesMethod {
5531

5632
/**
5733
* Gets the current device's geolocation coordinates.
5834
*
5935
* @return A {@link Location} containing the location information. Throws {@link WebDriverException} if the
6036
* location is not available.
6137
*/
62-
default io.appium.java_client.Location getLocation() {
38+
default Location getLocation() {
6339
Map<String, Number> result = CommandExecutionHelper.execute(this, MobileCommand.GET_LOCATION);
64-
return new io.appium.java_client.Location(
40+
return new Location(
6541
result.get("latitude").doubleValue(),
6642
result.get("longitude").doubleValue(),
6743
Optional.ofNullable(result.get("altitude")).map(Number::doubleValue).orElse(null)
@@ -72,20 +48,8 @@ default io.appium.java_client.Location getLocation() {
7248
* Sets the current device's geolocation coordinates.
7349
*
7450
* @param location A {@link Location} containing the new location information.
75-
* @deprecated This method and whole {@link LocationContext} interface are deprecated, use
76-
* {@link #setLocation(io.appium.java_client.Location)} instead.
7751
*/
78-
@Deprecated(forRemoval = true)
7952
default void setLocation(Location location) {
80-
getLocationContext().setLocation(location);
81-
}
82-
83-
/**
84-
* Sets the current device's geolocation coordinates.
85-
*
86-
* @param location A {@link Location} containing the new location information.
87-
*/
88-
default void setLocation(io.appium.java_client.Location location) {
8953
var locationParameters = new HashMap<String, Object>();
9054
locationParameters.put("latitude", location.getLatitude());
9155
locationParameters.put("longitude", location.getLongitude());

0 commit comments

Comments
 (0)