Rekha
Rekha

Reputation: 1

Could not start a new session. Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely

I am new to automation. Trying simple Selenium POC. Below is the webdriver configuration details

JDK version 17.0.2 Selenium version 4 Chrome browser version 98.0.4758.102 (Official Build) (64-bit) Chromedriver version is the same

This is my code: WebDriver driver=new ChromeDriver(); driver.get("https://demoqa.com/login");

I did setproperty. Please find attached screenshot.

error: 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:576) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:161) at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:108) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:106) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:93) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:48) at automationFramework.FirstSeleniumClass.main(FirstSeleniumClass.java:17) Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely. Build info: version: '4.1.2', revision: '9a5a329c5a' System info: host: 'ASG602977', ip: '192.168.0.5', os.name: 'Windows 10', 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:558) ... 7 more

enter image description here

Upvotes: 0

Views: 2382

Answers (1)

Tahir Akhlaq
Tahir Akhlaq

Reputation: 1

For Local execution you can use webdrivermanager.

Please refer to the link shared here to learn about the implementation.

WebDriver Manager Video Link

Here is the solution for Selenium 4 grid execution on Mac remote machine.

Please add chrome driver into the Path.

Download the compatible chromedriver: https://chromedriver.chromium.org

Go that Location:

First Run:

xattr -d com.apple.quarantine chromedriver

Then move ChromeDriver:

sudo chmod a+x chromedriver && sudo mv chromedriver /usr/local/bin/chromedriver

While registering the Node you can use flag --detect-drivers true

Upvotes: 0

Related Questions