Skip to content

Commit 198f42e

Browse files
committed
BREAKING CHANGE: remove all Location-related methods
classes `Location` and `LocationContext` have been removed in Selenium 4.35.0
1 parent 5806401 commit 198f42e

File tree

4 files changed

+3
-75
lines changed

4 files changed

+3
-75
lines changed

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: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,17 @@
2121
import io.appium.java_client.MobileCommand;
2222
import org.openqa.selenium.WebDriver;
2323
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;
2724

2825
import java.util.HashMap;
2926
import java.util.Map;
3027
import java.util.Optional;
3128

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-
}
29+
public interface SupportsLocation extends WebDriver, ExecutesMethod {
5530

5631
/**
5732
* Gets the current device's geolocation coordinates.
5833
*
59-
* @return A {@link Location} containing the location information. Throws {@link WebDriverException} if the
34+
* @return A {@link io.appium.java_client.Location} containing the location information. Throws {@link WebDriverException} if the
6035
* location is not available.
6136
*/
6237
default io.appium.java_client.Location getLocation() {
@@ -71,19 +46,7 @@ default io.appium.java_client.Location getLocation() {
7146
/**
7247
* Sets the current device's geolocation coordinates.
7348
*
74-
* @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.
77-
*/
78-
@Deprecated(forRemoval = true)
79-
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.
49+
* @param location A {@link io.appium.java_client.Location} containing the new location information.
8750
*/
8851
default void setLocation(io.appium.java_client.Location location) {
8952
var locationParameters = new HashMap<String, Object>();

0 commit comments

Comments
 (0)