Or via command line:
ChromeOptions options = new ChromeOptions(); WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444"), options); Instead of managing JAR manually, use Selenium Docker images: selenium server standalone jar
import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.DesiredCapabilities; import java.net.URL; public class RemoteTest public static void main(String[] args) throws Exception WebDriver driver = new RemoteWebDriver( new URL("http://localhost:4444"), DesiredCapabilities.chrome() ); driver.get("https://www.google.com"); System.out.println(driver.getTitle()); driver.quit(); Or via command line: ChromeOptions options = new
Or via command line:
ChromeOptions options = new ChromeOptions(); WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444"), options); Instead of managing JAR manually, use Selenium Docker images:
import org.openqa.selenium.WebDriver; import org.openqa.selenium.remote.RemoteWebDriver; import org.openqa.selenium.remote.DesiredCapabilities; import java.net.URL; public class RemoteTest public static void main(String[] args) throws Exception WebDriver driver = new RemoteWebDriver( new URL("http://localhost:4444"), DesiredCapabilities.chrome() ); driver.get("https://www.google.com"); System.out.println(driver.getTitle()); driver.quit();