Skip to content

Commit afd3232

Browse files
committed
Clear up FirefoxDriver constructors
This was one of the first drivers written, and it's been one of easiest to hack on. Consequently, it grew somewhat organically without much careful design and planning, and this is most clear in the wealth of constructors this thing has. Mark almost all the constructors as deprecated, so that we can remove them in a later release. I suspect that this will cause less chaos than might be imagined since most of the constructors seem highly specialised.
1 parent b966f72 commit afd3232

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,32 @@ private static FirefoxBinary getBinary(Capabilities capabilities) {
259259
return new FirefoxBinary();
260260
}
261261

262+
/**
263+
* @deprecated Use {@link FirefoxDriver(Capabilities, Capabilities)} setting the binary and
264+
* profile using {@link FirefoxOptions} set as the capability {@link
265+
* FirefoxOptions#FIREFOX_OPTIONS}
266+
*/
267+
@Deprecated
262268
public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile) {
263269
this(binary, profile, DesiredCapabilities.firefox());
264270
}
265271

272+
/**
273+
* @deprecated Use {@link FirefoxDriver(Capabilities, Capabilities)} setting the binary and
274+
* profile using {@link FirefoxOptions} set as the capability {@link
275+
* FirefoxOptions#FIREFOX_OPTIONS}
276+
*/
277+
@Deprecated
266278
public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile, Capabilities capabilities) {
267279
this(binary, profile, capabilities, null);
268280
}
269281

282+
/**
283+
* @deprecated Use {@link FirefoxDriver(Capabilities, Capabilities)} setting the binary and
284+
* profile using {@link FirefoxOptions} set as the capability {@link
285+
* FirefoxOptions#FIREFOX_OPTIONS}
286+
*/
287+
@Deprecated
270288
public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile,
271289
Capabilities desiredCapabilities, Capabilities requiredCapabilities) {
272290
this(createCommandExecutor(desiredCapabilities, requiredCapabilities, binary, profile),
@@ -275,19 +293,35 @@ public FirefoxDriver(FirefoxBinary binary, FirefoxProfile profile,
275293
this.binary = binary;
276294
}
277295

296+
/**
297+
* @deprecated No replacement.
298+
*/
299+
@Deprecated
278300
public FirefoxDriver(GeckoDriverService driverService) {
279301
this(new DriverCommandExecutor(driverService), null, null);
280302
}
281303

304+
/**
305+
* @deprecated No replacement.
306+
*/
307+
@Deprecated
282308
public FirefoxDriver(GeckoDriverService driverService, Capabilities desiredCapabilities) {
283309
this(new DriverCommandExecutor(driverService), desiredCapabilities, null);
284310
}
285311

312+
/**
313+
* @deprecated No replacement.
314+
*/
315+
@Deprecated
286316
public FirefoxDriver(GeckoDriverService driverService, Capabilities desiredCapabilities,
287317
Capabilities requiredCapabilities) {
288318
this(new DriverCommandExecutor(driverService), desiredCapabilities, requiredCapabilities);
289319
}
290320

321+
/**
322+
* @deprecated No replacement.
323+
*/
324+
@Deprecated
291325
private FirefoxDriver(CommandExecutor executor, Capabilities desiredCapabilities,
292326
Capabilities requiredCapabilities) {
293327
super(executor,

0 commit comments

Comments
 (0)