//-Begin----------------------------------------------------------------
//-
//- Successfully checked with Java 14.0.2 and WebDriver 3.141.59
//-
//- Compile with
//- @"%JAVA_HOME%\bin\javac.exe" -cp client-combined-3.141.59.jar ^
//- selenium.java
//-
//- Execute with
//- @"%JAVA_HOME%\bin\java.exe" -cp .;client-combined-3.141.59.jar;^
//- byte-buddy-1.8.15.jar;commons-exec-1.3.jar;guava-25.0-jre.jar;^
//- okhttp-3.11.0.jar;okio-1.14.0.jar ^
//- -Djava.library.path=C:\Dummy Selenium
//-
//----------------------------------------------------------------------

import java.util.*;

import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.*;

public class selenium {

  public static void main(String[] args) {

    //-Set path to chromedriver-----------------------------------------
    System.setProperty(
      "webdriver.chrome.driver",
      "C:\\Projects\\Selenium\\chromedriver.exe"
    );

    //-Set path to Chrome browser---------------------------------------
    ChromeOptions chromeOptions = new ChromeOptions();
    chromeOptions.setBinary(
      "C:\\Tools\\Google\\Chrome\\Application\\chrome.exe"
    );

    WebDriver webDriver = new ChromeDriver(chromeOptions);

    webDriver.get("http://www.google.com");
    try {
      Thread.sleep(5000);
    } catch (Exception e) {

    }

    WebElement searchBox = webDriver.findElement(By.name("q"));
    searchBox.sendKeys("ChromeDriver");
    searchBox.submit();
    try {
      Thread.sleep(5000);
    } catch (Exception e) {

    }

    webDriver.close();
    webDriver.quit();

  }

}

//-End------------------------------------------------------------------