[java] Fixing code example in ChromeDriver javadoc [skip ci]
* import org.junit.*;
* import org.junit.runner.RunWith;
* import org.junit.runners.JUnit4;
+ * import org.openqa.selenium.By;
+ * import org.openqa.selenium.WebDriver;
+ * import org.openqa.selenium.WebElement;
* import org.openqa.selenium.chrome.ChromeDriverService;
- * import org.openqa.selenium.remote.DesiredCapabilities;
+ * import org.openqa.selenium.chrome.ChromeOptions;
* import org.openqa.selenium.remote.RemoteWebDriver;
*
+ * import java.io.File;
+ * import java.io.IOException;
+ *
* {@literal @RunWith(JUnit4.class)}
- * public class ChromeTest extends TestCase {
+ * public class ChromeTest {
*
* private static ChromeDriverService service;
* private WebDriver driver;
*
* {@literal @BeforeClass}
- * public static void createAndStartService() {
+ * public static void createAndStartService() throws IOException {
* service = new ChromeDriverService.Builder()
* .usingDriverExecutable(new File("path/to/my/chromedriver.exe"))
* .usingAnyFreePort()
*
* {@literal @Before}
* public void createDriver() {
- * driver = new RemoteWebDriver(service.getUrl(),
- * DesiredCapabilities.chrome());
+ * driver = new RemoteWebDriver(service.getUrl(), new ChromeOptions());
* }
*
* {@literal @After}
* driver.get("http://www.google.com");
* WebElement searchBox = driver.findElement(By.name("q"));
* searchBox.sendKeys("webdriver");
- * searchBox.quit();
+ * searchBox.sendKeys(Keys.ENTER);
* assertEquals("webdriver - Google Search", driver.getTitle());
* }
* }
