Skip to content

Commit b3f9d37

Browse files
committed
[java] Add deprecated warnings to OperaDriver and OperaOptions
1 parent fb69a4f commit b3f9d37

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

‎java/src/org/openqa/selenium/opera/OperaDriver.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,35 @@
3131
import org.openqa.selenium.remote.html5.RemoteWebStorage;
3232
import org.openqa.selenium.remote.service.DriverCommandExecutor;
3333

34+
import java.io.File;
35+
3436
/**
3537
* A {@link WebDriver} implementation that controls a Blink-based Opera browser running on the local
3638
* machine. It requires an <code>operadriver</code> executable to be available in PATH.
3739
*
3840
* @see <a href="https://github.com/operasoftware/operachromiumdriver">operadriver</a>
41+
*
42+
* Since operadriver does not support w3c, Selenium will remove the support in the next version.
43+
* @deprecated Use {@link org.openqa.selenium.chrome.ChromeDriver} with
44+
* {@link org.openqa.selenium.chrome.ChromeOptions#setBinary(File)} or {@link org.openqa.selenium.chrome.ChromeOptions#setBinary(String)}
45+
* to set the path to the Opera browser.
46+
*
47+
* <p>Example usage:
48+
* <pre><code>
49+
* ChromeOptions options = new ChromeOptions()
50+
* options.setBinary(new File("/path/to/opera"));
51+
*
52+
* // For using Opera browser with ChromeDriver:
53+
* ChromeDriver driver = new ChromeDriver(options);
54+
*
55+
* // For use with RemoteWebDriver:
56+
* ChromeOptions options = new ChromeOptions();
57+
* options.setBinary(new File("/path/to/opera"));
58+
* RemoteWebDriver driver = new RemoteWebDriver(
59+
* new URL("http://localhost:4444/"), options);
60+
* </code></pre>
3961
*/
62+
@Deprecated
4063
public class OperaDriver extends RemoteWebDriver
4164
implements LocationContext, WebStorage {
4265

‎java/src/org/openqa/selenium/opera/OperaOptions.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,28 @@
4848
* RemoteWebDriver driver = new RemoteWebDriver(
4949
* new URL("http://localhost:4444/"), options);
5050
* </code></pre>
51+
*
52+
* Since operadriver does not support w3c, Selenium will remove the support in the next version.
53+
* @deprecated Use {@link org.openqa.selenium.chrome.ChromeDriver} with
54+
* {@link org.openqa.selenium.chrome.ChromeOptions#setBinary(File)} or {@link org.openqa.selenium.chrome.ChromeOptions#setBinary(String)}
55+
* to set the path to the Opera browser.
56+
*
57+
* <p>Example usage:
58+
* <pre><code>
59+
* ChromeOptions options = new ChromeOptions()
60+
* options.setBinary(new File("/path/to/opera"));
61+
*
62+
* // For using Opera browser with ChromeDriver:
63+
* ChromeDriver driver = new ChromeDriver(options);
64+
*
65+
* // For use with RemoteWebDriver:
66+
* ChromeOptions options = new ChromeOptions();
67+
* options.setBinary(new File("/path/to/opera"));
68+
* RemoteWebDriver driver = new RemoteWebDriver(
69+
* new URL("http://localhost:4444/"), options);
70+
* </code></pre>
5171
*/
72+
@Deprecated
5273
public class OperaOptions extends AbstractDriverOptions<OperaOptions> {
5374

5475
/**

0 commit comments

Comments
 (0)