Reputation: 11
Sep 13, 2021 1:38:45 PM cucumber.api.cli.Main run
WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main
Scenario: Login with valid credentials # src/test/resources/features/landing.feature:7
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.
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Starting ChromeDriver 93.0.4577.63 (ff5c0da2ec0adeaed5550e6c7e98417dac77d98a-refs/branch-heads/4577@{#1135}) on port 44611
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
org.openqa.selenium.SessionNotCreatedException: **Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.**
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.0.0-beta-4', revision: '29f46d02dd'
System info: host: 'INBGL1WLX50908', ip: '192.168.1.2', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:162)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:137)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:612)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:165)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:89)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:99)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:86)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:41)
at com.cucumberFramework.testBase.TestBase.selectBrowser(TestBase.java:29)
at com.cucumberFramework.stepDefinitions.ServiceHooks.initializeTest(ServiceHooks.java:16)
Given I am on the login page URL "https://admin-demo.nopcommerce.com/login" # com.cucumberFramework.stepDefinitions.landingStepDefinistions.i_am_on_the_login_page_url(java.lang.String)
Then I should see the login page # com.cucumberFramework.stepDefinitions.landingStepDefinistions.i_should_see_the_login_page()
When I enter username as "[email protected]" # com.cucumberFramework.stepDefinitions.landingStepDefinistions.i_enter_username_as(java.lang.String)
And I enter password as "admin" # com.cucumberFramework.stepDefinitions.landingStepDefinistions.i_enter_password_as(java.lang.String)
And Click on login button # com.cucumberFramework.stepDefinitions.landingStepDefinistions.click_on_login_button()
Then I should see application homepage # com.cucumberFramework.stepDefinitions.landingStepDefinistions.i_should_see_application_homepage()
And I should see logout link # com.cucumberFramework.stepDefinitions.landingStepDefinistions.i_should_see_logout_link()
java.lang.NullPointerException
at com.cucumberFramework.stepDefinitions.ServiceHooks.endTest(ServiceHooks.java:21)
Failed scenarios:
file:///C:/Users/U1104906/OneDrive%20-%20IQVIA/IPSD_WorkSpace/cucumberFramework/src/test/resources/features/landing.feature:7 # Login with valid credentials
1 Scenarios (1 failed)
7 Steps (7 skipped)
0m6.134s
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.0.0-beta-4', revision: '29f46d02dd'
System info: host: 'INBGL1WLX50908', ip: '192.168.1.2', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:84)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:62)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:162)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:137)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:612)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:165)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:89)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:99)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:86)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:41)
at com.cucumberFramework.testBase.TestBase.selectBrowser(TestBase.java:29)
at com.cucumberFramework.stepDefinitions.ServiceHooks.initializeTest(ServiceHooks.java:16)
java.lang.NullPointerException
at com.cucumberFramework.stepDefinitions.ServiceHooks.endTest(ServiceHooks.java:21)
┌───────────────────────────────────────────────────────────────────────────────────┐
│ Share your Cucumber Report with your team at https://reports.cucumber.io │
│ Activate publishing with one of the following: │
│ │
│ src/test/resources/cucumber.properties: cucumber.publish.enabled=true │
│ src/test/resources/junit-platform.properties: cucumber.publish.enabled=true │
│ Environment variable: CUCUMBER_PUBLISH_ENABLED=true │
│ JUnit: @CucumberOptions(publish = true) │
│ │
│ More information at https://cucumber.io/docs/cucumber/environment-variables/ │
│ │
│ Disable this message with one of the following: │
│ │
│ src/test/resources/cucumber.properties: cucumber.publish.quiet=true │
│ src/test/resources/junit-platform.properties: cucumber.publish.quiet=true │
└───────────────────────────────────────────────────────────────────────────────────┘
Upvotes: 0
Views: 6488
Reputation: 838
Please use web driver manager for driver initialization, this library internally taking care of drivers depends upon your OS, Arch and version of chrome.
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
Upvotes: 1
Reputation: 325
Please update your chrome selenium driver based on your browser version.
Upvotes: 1