Error - org.openqa.selenium.SessionNotCreatedException: Could not start a new session
I am facing a dependency issue while calling selenium from ReadyAPI.
Ready API version - 3.20.0
All selenium libraries are placed directly in ReadyAPI install directory E:\ReadyAPI-3.20.0\bin\ext
Selenium with Java version : 4.1.1 (December 17, 2021)
Chrome version is - Version 97.0.4692.71
Chromedriver version is that compatible with 97.0.4692.71
Chromedriver.exe is placed directly in ReadyAPI install directory E:\ReadyAPI-3.20.0\bin\ext
Following is the Groovy script I have in my Ready API test:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.concurrent.TimeUnit
System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"\\ext\\chromedriver.exe");
log.info(System.getProperty('webdriver.chrome.driver'))
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com");
On executing the script, i get the following error:
Tue Jan 18 20:21:23 CST 2022: ERROR: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
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:577)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:168)
at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:108)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:104)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:91)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:46)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:268)
at Script1.run(Script1.groovy:6)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.runAndGetResult(SoapUIGroovyScriptEngine.java:111)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:97)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:98)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:159)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:334)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'SOAPUI-PRO-5', ip: '10.39.186.126', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '16.0.1'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:227)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:95)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:559)
... 25 more
Caused by: java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: 'My host machine name', ip: 'My IP', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '16.0.1'
Driver info: driver.version: unknown
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2092)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:217)
... 27 more
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '4.1.0', revision: '87802e897b'
System info: host: host: 'My host machine name', ip: 'My IP', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '16.0.1'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:248)
at org.openqa.selenium.remote.service.DriverService.lambda$start$1(DriverService.java:202)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1764)
... 3 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:64319/status] to be available after 20002 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:89)
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:244)
... 5 more
Caused by: java.util.concurrent.TimeoutException
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:204)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:87)
... 6 more