I'm just a new java developer I'm trying to use the selenium library to do some test cases but I'm experiencing this confusing issue as shown in the image below:
package automationFramework;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class FirstTestCase {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver","chromedriver_win3222\\chromedriver.exe");
WebDriver wd =new ChromeDriver();
String baseUrl = "https://www.google.com";
wd.get(baseUrl);
}
}
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.
Invalid port. Exiting...
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.
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:587)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:264)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:179)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:101)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:81)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:49)
at automationFramework.FirstTestCase.main(FirstTestCase.java:13)
Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely.
Build info: version: '4.3.0', revision: 'a4995e2c09*'
System info: host: 'DESKTOP-G3NE69C', ip: '192.168.56.1', os.name: 'Windows 11', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.2'
Driver info: driver.version: ChromeDriver
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:569)
I can deal with the first error "SLF4J" but I really need other issues to be solved.