Skip to content

Commit 2d71c4b

Browse files
committed
[skip ci][java] Deleting outdated code examples from javadocs
1 parent 6e7b239 commit 2d71c4b

File tree

5 files changed

+7
-279
lines changed

5 files changed

+7
-279
lines changed

java/client/src/org/openqa/selenium/chrome/ChromeDriver.java

+2-71
Original file line numberDiff line numberDiff line change
@@ -21,82 +21,13 @@
2121
import org.openqa.selenium.WebDriver;
2222
import org.openqa.selenium.chromium.ChromiumDriver;
2323
import org.openqa.selenium.chromium.ChromiumDriverCommandExecutor;
24-
import org.openqa.selenium.html5.LocationContext;
25-
import org.openqa.selenium.html5.WebStorage;
2624
import org.openqa.selenium.remote.RemoteWebDriver;
2725

2826
/**
2927
* A {@link WebDriver} implementation that controls a Chrome browser running on the local machine.
30-
* This class is provided as a convenience for easily testing the Chrome browser. The control server
31-
* which each instance communicates with will live and die with the instance.
28+
* It requires a <code>chromedriver</code> executable to be available in PATH.
3229
*
33-
* To avoid unnecessarily restarting the ChromeDriver server with each instance, use a
34-
* {@link RemoteWebDriver} coupled with the desired {@link ChromeDriverService}, which is managed
35-
* separately. For example: <pre>{@code
36-
*
37-
* import static org.junit.Assert.assertEquals;
38-
*
39-
* import org.junit.*;
40-
* import org.junit.runner.RunWith;
41-
* import org.junit.runners.JUnit4;
42-
* import org.openqa.selenium.By;
43-
* import org.openqa.selenium.WebDriver;
44-
* import org.openqa.selenium.WebElement;
45-
* import org.openqa.selenium.chrome.ChromeDriverService;
46-
* import org.openqa.selenium.chrome.ChromeOptions;
47-
* import org.openqa.selenium.remote.RemoteWebDriver;
48-
*
49-
* import java.io.File;
50-
* import java.io.IOException;
51-
*
52-
* {@literal @RunWith(JUnit4.class)}
53-
* public class ChromeTest {
54-
*
55-
* private static ChromeDriverService service;
56-
* private WebDriver driver;
57-
*
58-
* {@literal @BeforeClass}
59-
* public static void createAndStartService() throws IOException {
60-
* service = new ChromeDriverService.Builder()
61-
* .usingDriverExecutable(new File("path/to/my/chromedriver.exe"))
62-
* .usingAnyFreePort()
63-
* .build();
64-
* service.start();
65-
* }
66-
*
67-
* {@literal @AfterClass}
68-
* public static void createAndStopService() {
69-
* service.stop();
70-
* }
71-
*
72-
* {@literal @Before}
73-
* public void createDriver() {
74-
* driver = new RemoteWebDriver(service.getUrl(), new ChromeOptions());
75-
* }
76-
*
77-
* {@literal @After}
78-
* public void quitDriver() {
79-
* driver.quit();
80-
* }
81-
*
82-
* {@literal @Test}
83-
* public void testGoogleSearch() {
84-
* driver.get("http://www.google.com");
85-
* WebElement searchBox = driver.findElement(By.name("q"));
86-
* searchBox.sendKeys("webdriver");
87-
* searchBox.sendKeys(Keys.ENTER);
88-
* assertEquals("webdriver - Google Search", driver.getTitle());
89-
* }
90-
* }
91-
* }</pre>
92-
*
93-
* Note that unlike ChromeDriver, RemoteWebDriver doesn't directly implement
94-
* role interfaces such as {@link LocationContext} and {@link WebStorage}.
95-
* Therefore, to access that functionality, it needs to be
96-
* {@link org.openqa.selenium.remote.Augmenter augmented} and then cast
97-
* to the appropriate interface.
98-
*
99-
* @see ChromeDriverService#createDefaultService
30+
* @see <a href="https://sites.google.com/a/chromium.org/chromedriver/">chromedriver</a>
10031
*/
10132
public class ChromeDriver extends ChromiumDriver {
10233

java/client/src/org/openqa/selenium/chromium/ChromiumDriver.java

+1-12
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,7 @@
5959

6060
/**
6161
* A {@link WebDriver} implementation that controls a Chromium browser running on the local machine.
62-
* This class is provided as a convenience for easily testing the Chromium browser. The control server
63-
* which each instance communicates with will live and die with the instance.
64-
* <p>
65-
* To avoid unnecessarily restarting the ChromiumDriver server with each instance, use a
66-
* {@link RemoteWebDriver} coupled with the desired WebDriverService, which is managed
67-
* separately.
68-
* <p>
69-
* Note that unlike ChromiumDriver, RemoteWebDriver doesn't directly implement
70-
* role interfaces such as {@link LocationContext} and {@link WebStorage}.
71-
* Therefore, to access that functionality, it needs to be
72-
* {@link org.openqa.selenium.remote.Augmenter augmented} and then cast
73-
* to the appropriate interface.
62+
* It is used as the base class for Chromium-based browser drivers (Chrome, Edgium).
7463
*/
7564
public class ChromiumDriver extends RemoteWebDriver implements
7665
HasAuthentication,

java/client/src/org/openqa/selenium/edge/EdgeDriver.java

+2-67
Original file line numberDiff line numberDiff line change
@@ -26,74 +26,9 @@
2626

2727
/**
2828
* A {@link WebDriver} implementation that controls an Edge browser running on the local machine.
29-
* This class is provided as a convenience for easily testing the Edge browser. The control server
30-
* which each instance communicates with will live and die with the instance.
29+
* It requires an <code>edgedriver</code> executable to be available in PATH.
3130
*
32-
* To avoid unnecessarily restarting the Microsoft WebDriver server with each instance, use a
33-
* {@link RemoteWebDriver} coupled with the desired {@link EdgeDriverService}, which is managed
34-
* separately. For example: <pre>{@code
35-
*
36-
* import org.junit.jupiter.api.*;
37-
* import org.openqa.selenium.By;
38-
* import org.openqa.selenium.WebDriver;
39-
* import org.openqa.selenium.WebDriverException;
40-
* import org.openqa.selenium.WebElement;
41-
* import org.openqa.selenium.edge.EdgeDriverService;
42-
* import org.openqa.selenium.edge.EdgeOptions;
43-
* import org.openqa.selenium.remote.RemoteWebDriver;
44-
* import org.openqa.selenium.remote.service.DriverService;
45-
*
46-
* import java.io.IOException;
47-
* import java.util.ServiceLoader;
48-
* import java.util.stream.StreamSupport;
49-
*
50-
* import static org.junit.jupiter.api.Assertions.assertEquals;
51-
*
52-
* public class EdgeTest {
53-
*
54-
* private static EdgeDriverService service;
55-
* private WebDriver driver;
56-
*
57-
* {@Literal @BeforeAll}
58-
* public static void createAndStartService() {
59-
* // Setting this property to false in order to launch Chromium Edge
60-
* // Otherwise, old Edge will be launched by default
61-
* System.setProperty("webdriver.edge.edgehtml", "false");
62-
* EdgeDriverService.Builder builder = = new EdgeDriverService.Builder();
63-
* service = builder.build();
64-
* try {
65-
* service.start();
66-
* }
67-
* catch (IOException e) {
68-
* throw new RuntimeException(e);
69-
* }
70-
* }
71-
*
72-
* {@Literal @AfterAll}
73-
* public static void createAndStopService() {
74-
* service.stop();
75-
* }
76-
*
77-
* {@Literal @BeforeEach}
78-
* public void createDriver() {
79-
* driver = new RemoteWebDriver(service.getUrl(),
80-
* new EdgeOptions());
81-
* }
82-
*
83-
* {@Literal @AfterEach}
84-
* public void quitDriver() {
85-
* driver.quit();
86-
* }
87-
*
88-
* {@Literal @Test}
89-
* public void testBingSearch() {
90-
* driver.get("http://www.bing.com");
91-
* WebElement searchBox = driver.findElement(By.name("q"));
92-
* searchBox.sendKeys("webdriver");
93-
* searchBox.submit();
94-
* assertEquals("webdriver - Bing", driver.getTitle());
95-
* }
96-
* }}</pre>
31+
* @see <a href="https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/">Microsoft WebDriver</a>
9732
*/
9833
public class EdgeDriver extends ChromiumDriver {
9934

java/client/src/org/openqa/selenium/edgehtml/EdgeHtmlDriver.java

-65
Original file line numberDiff line numberDiff line change
@@ -23,71 +23,6 @@
2323

2424
/**
2525
* A {@link WebDriver} implementation that controls an Edge browser running on the local machine.
26-
* This class is provided as a convenience for easily testing the Edge browser. The control server
27-
* which each instance communicates with will live and die with the instance.
28-
*
29-
* To avoid unnecessarily restarting the Microsoft WebDriver server with each instance, use a
30-
* {@link RemoteWebDriver} coupled with the desired {@link EdgeHtmlDriverService}, which is managed
31-
* separately. For example: <pre>{@code
32-
*
33-
* import org.junit.jupiter.api.*;
34-
* import org.openqa.selenium.By;
35-
* import org.openqa.selenium.WebDriver;
36-
* import org.openqa.selenium.WebDriverException;
37-
* import org.openqa.selenium.WebElement;
38-
* import org.openqa.selenium.edgehtml.EdgeHtmlDriverService;
39-
* import org.openqa.selenium.edgehtml.EdgeHtmlOptions;
40-
* import org.openqa.selenium.remote.RemoteWebDriver;
41-
* import org.openqa.selenium.remote.service.DriverService;
42-
*
43-
* import java.io.IOException;
44-
* import java.util.ServiceLoader;
45-
* import java.util.stream.StreamSupport;
46-
*
47-
* import static org.junit.jupiter.api.Assertions.assertEquals;
48-
*
49-
* public class EdgeHtmlTest {
50-
*
51-
* private static EdgeHtmlDriverService service;
52-
* private WebDriver driver;
53-
*
54-
* {@Literal @BeforeAll}
55-
* public static void createAndStartService() {
56-
* EdgeHtmlDriverService.Builder builder = new EdgeHtmlDriverService.Builder();
57-
* service = builder.build();
58-
* try {
59-
* service.start();
60-
* }
61-
* catch (IOException e) {
62-
* throw new RuntimeException(e);
63-
* }
64-
* }
65-
*
66-
* {@Literal @AfterAll}
67-
* public static void createAndStopService() {
68-
* service.stop();
69-
* }
70-
*
71-
* {@Literal @BeforeEach}
72-
* public void createDriver() {
73-
* driver = new RemoteWebDriver(service.getUrl(),
74-
* new EdgeHtmlOptions());
75-
* }
76-
*
77-
* {@Literal @AfterEach}
78-
* public void quitDriver() {
79-
* driver.quit();
80-
* }
81-
*
82-
* {@Literal @Test}
83-
* public void testBingSearch() {
84-
* driver.get("http://www.bing.com");
85-
* WebElement searchBox = driver.findElement(By.name("q"));
86-
* searchBox.sendKeys("webdriver");
87-
* searchBox.submit();
88-
* assertEquals("webdriver - Bing", driver.getTitle());
89-
* }
90-
* }}</pre>
9126
*/
9227
public class EdgeHtmlDriver extends RemoteWebDriver {
9328

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

+2-64
Original file line numberDiff line numberDiff line change
@@ -33,71 +33,9 @@
3333

3434
/**
3535
* A {@link WebDriver} implementation that controls a Blink-based Opera browser running on the local
36-
* machine. This class is provided as a convenience for easily testing the Chrome browser. The
37-
* control server which each instance communicates with will live and die with the instance.
36+
* machine. It requires an <code>operadriver</code> executable to be available in PATH.
3837
*
39-
* To avoid unnecessarily restarting the OperaDriver server with each instance, use a
40-
* {@link RemoteWebDriver} coupled with the desired {@link OperaDriverService}, which is managed
41-
* separately. For example: <pre>{@code
42-
*
43-
* import static org.junit.Assert.assertEquals;
44-
*
45-
* import org.junit.*;
46-
* import org.junit.runner.RunWith;
47-
* import org.junit.runners.JUnit4;
48-
* import org.openqa.selenium.opera.OperaDriverService;
49-
* import org.openqa.selenium.remote.DesiredCapabilities;
50-
* import org.openqa.selenium.remote.RemoteWebDriver;
51-
*
52-
* {@literal @RunWith(JUnit4.class)}
53-
* public class OperaTest extends TestCase {
54-
*
55-
* private static OperaDriverService service;
56-
* private WebDriver driver;
57-
*
58-
* {@literal @BeforeClass}
59-
* public static void createAndStartService() {
60-
* service = new OperaDriverService.Builder()
61-
* .usingDriverExecutable(new File("path/to/my/operadriver.exe"))
62-
* .usingAnyFreePort()
63-
* .build();
64-
* service.start();
65-
* }
66-
*
67-
* {@literal @AfterClass}
68-
* public static void createAndStopService() {
69-
* service.stop();
70-
* }
71-
*
72-
* {@literal @Before}
73-
* public void createDriver() {
74-
* driver = new RemoteWebDriver(service.getUrl(),
75-
* DesiredCapabilities.opera());
76-
* }
77-
*
78-
* {@literal @After}
79-
* public void quitDriver() {
80-
* driver.quit();
81-
* }
82-
*
83-
* {@literal @Test}
84-
* public void testGoogleSearch() {
85-
* driver.get("http://www.google.com");
86-
* WebElement searchBox = driver.findElement(By.name("q"));
87-
* searchBox.sendKeys("webdriver");
88-
* searchBox.quit();
89-
* assertEquals("webdriver - Google Search", driver.getTitle());
90-
* }
91-
* }
92-
* }</pre>
93-
*
94-
* Note that unlike OperaDriver, RemoteWebDriver doesn't directly implement
95-
* role interfaces such as {@link LocationContext} and {@link WebStorage}.
96-
* Therefore, to access that functionality, it needs to be
97-
* {@link org.openqa.selenium.remote.Augmenter augmented} and then cast
98-
* to the appropriate interface.
99-
*
100-
* @see OperaDriverService#createDefaultService
38+
* @see <a href="https://github.com/operasoftware/operachromiumdriver">opersdriver</a>
10139
*/
10240
public class OperaDriver extends RemoteWebDriver
10341
implements LocationContext, WebStorage {

0 commit comments

Comments
 (0)