0

My code is

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

import java.security.Key;

public class Main {

    public static void main(String[] args) {

        System.setProperty("webdriver.gecko.driver","/Users/ahmadawad/Documents/geckodriver");

        //WebDriver driver = new ChromeDriver();

        WebDriver driver=new FirefoxDriver();

        driver.get("https://testmy.net/");

        System.out.println(driver.getTitle());

        System.out.println(driver.getCurrentUrl());

        driver.close();

    }

}

The error message is

/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=50157:/Applications/IntelliJ IDEA CE.app/Contents/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath /Users/ahmadawad/IdeaProjects/untitled1/out/production/untitled1:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/async-http-client-2.12.3.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/async-http-client-netty-utils-2.12.3.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/auto-common-1.2.1.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/auto-service-1.0.1.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/auto-service-annotations-1.0.1.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/byte-buddy-1.12.14.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/checker-qual-3.12.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/commons-exec-1.3.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/error_prone_annotations-2.11.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/failsafe-3.2.4.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/failureaccess-1.0.1.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/guava-31.1-jre.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/j2objc-annotations-1.3.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/jakarta.activation-1.2.2.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/jcommander-1.82.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/jsr305-3.0.2.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/jtoml-2.0.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-buffer-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-codec-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-codec-http-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-codec-socks-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-common-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-handler-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-handler-proxy-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-reactive-streams-2.0.4.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-resolver-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-transport-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-transport-classes-epoll-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-transport-classes-kqueue-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-transport-native-epoll-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-transport-native-unix-common-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-api-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-context-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-exporter-common-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-exporter-logging-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-sdk-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-sdk-common-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-sdk-extension-autoconfigure-1.17.0-alpha.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-sdk-extension-autoconfigure-spi-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-sdk-logs-1.17.0-alpha.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-sdk-metrics-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-sdk-trace-1.17.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/opentelemetry-semconv-1.17.0-alpha.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/reactive-streams-1.0.4.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/slf4j-api-1.7.36.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-api-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-chrome-driver-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-chromium-driver-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-devtools-v85-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-devtools-v104-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-devtools-v105-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-devtools-v106-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-edge-driver-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-firefox-driver-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-http-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-ie-driver-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-java-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-json-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-remote-driver-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-safari-driver-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/selenium-support-4.5.0.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/netty-transport-native-kqueue-4.1.79.Final.jar:/Users/ahmadawad/Downloads/selenium-java-4.5.0/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar Main SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'android-dc50ee66dbffc3cc.home', ip: '2a01:9700:1023:8800:248e:e9eb:f992:c8f%en0' at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:565) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:110) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:98) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:94) at Main.main(Main.java:10) Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely. Build info: version: '4.5.0', revision: 'fe167b119a' System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '12.6', java.version: '19' Driver info: driver.version: FirefoxDriver at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:226) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:98) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:547) ... 6 more

Process finished with exit code 1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.