Java script (selenium framwork ) which is not running on Chrome.
I have tried all possible ways:
- Uncheck run as admin
- Add arguments
Code Block:
ChromeOptions options = new ChromeOptions();
//options.setExperimentalOption("debuggerAddress", "127.0.0.1:9222");
options.setBinary("C:/Program Files/Google/Chrome/Application/chrome.exe");
options.addArguments("--no-sandbox");
options.addArguments("--headless");
options.addArguments("--disable-gpu");
options.setExperimentalOption("useAutomationExtension", false);
options.addArguments("start-maximized"); // open Browser in maximized mode
options.addArguments("--disable-extensions"); // disabling extensions
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--remote-debugging-port=9222");
Chrome version: 108.0.5359.125
selenium-java-3.141.59
selenium-server-3.4.0
We are using web driver manager
os -win10
Error:
"C:\Program Files\Java\jdk1.8.0_351\bin\java.exe" -C:/Users/..../ISA/src/test/resources/Checklist/NFTE1_Confirm_login.feature
Testing started at 09:07 AM ...
inside chrome browser configuration
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.
Starting ChromeDriver 108.0.5359.71 (1e0e3868ee06e91ad636a874420e3ca3ae3756ac-refs/branch-heads/5359@{#1016}) on port 35499
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1674119263.153][WARNING]: Deprecated chrome option is ignored: useAutomationExtension
[1674119263.156][WARNING]: Deprecated chrome option is ignored: useAutomationExtension
Skipped step
Skipped step
Executed scenario successfully
Failed scenarios:
C:/Users/...../ISA/src/test/resources/Checklist/NFTE1_Confirm_login.feature:15 # Scenario Outline: Login to ISA
1 Scenarios (1 failed)
2 Steps (2 skipped)
0m20.488s
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(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.)
CodePudding user response:
Either use:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
or you use:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.4.0</version>
</dependency>
But not both.