I developed a app to read some web pages using Selenium.
ChromeDriver on windows worked correctly but in unix base Oss (Mac & Centos7) does not worked!
I think a problem is "Forwarding newSession on session null to remote" in the unix base OSs.
Some warnings and info when I ran app in unix base OSs are as bellow:
Starting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005#{#819}) on port 53751
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1658989503.540][WARNING]: This version of ChromeDriver has not been tested with Chrome version 103.
28-Jul-2022 10:55:03.613 INFO [Forwarding newSession on session null to remote] org.openqa.selenium.remote.ProtocolHandshake.createSession Detected dialect: W3C
28-Jul-2022 10:55:03.673 WARNING [main] org.openqa.selenium.devtools.CdpVersionFinder.findNearestMatch Unable to find an exact match for CDP version 103, so returning the closest version found: a no-op implementation
28-Jul-2022 10:55:03.673 INFO [main] org.openqa.selenium.devtools.CdpVersionFinder.findNearestMatch Unable to find CDP implementation matching 103.
28-Jul-2022 10:55:03.674 WARNING [main] org.openqa.selenium.chromium.ChromiumDriver.lambda$new$3 Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.1.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
Are there any solutions to resolve ChromeDriver error?
If you have any suggestions that can be help me, please add comment or answer.
Thanks.
This error message...
Starting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005#{#819}) on port 53751
.
[1658989503.540][WARNING]: This version of ChromeDriver has not been tested with Chrome version 103.
.
28-Jul-2022 10:55:03.613 INFO [Forwarding newSession on session null to remote] org.openqa.selenium.remote.ProtocolHandshake.createSession Detected dialect: W3C
28-Jul-2022 10:55:03.673 WARNING [main] org.openqa.selenium.devtools.CdpVersionFinder.findNearestMatch Unable to find an exact match for CDP version 103, so returning the closest version found: a no-op implementation
28-Jul-2022 10:55:03.673 INFO [main] org.openqa.selenium.devtools.CdpVersionFinder.findNearestMatch Unable to find CDP implementation matching 103.
28-Jul-2022 10:55:03.674 WARNING [main] org.openqa.selenium.chromium.ChromiumDriver.lambda$new$3 Unable to find version of CDP to use for . You may need to include a dependency on a specific version of the CDP using something similar to `org.seleniumhq.selenium:selenium-devtools-v86:4.1.0` where the version ("v86") matches the version of the chromium-based browser you're using and the version number of the artifact is the same as Selenium's.
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. google-chrome session.
Your main issue is the incompatibility between the version of the binaries you are using.
Solution
Ensure that:
Selenium is upgraded to current released Version 4.3.0.
ChromeDriver is updated to current ChromeDriver v103.0 level.
Chrome Browser is updated to current chrome=103.0 (as per chromedriver=103.0.5060.53 release notes).
Related
I'm running simple Selenium test, which uses selenium version 4.0.0 and chromedriver version 109. I'm running automation test on Salesforce application, which logs into the application and performs some operation. In the middle of the test execution, I get below error:
Jan 23, 2023 7:58:23 PM org.openqa.selenium.devtools.Connection handle
INFO: <- {"method":"Inspector.detached","params":{"reason":"target_closed"}}
Jan 23, 2023 7:58:23 PM org.openqa.selenium.devtools.Connection handle
INFO: Method Inspector.detached called with 0 callbacks available
After this connection to the browser is lost and when any further selenium webdriver statement(e.g. findElement) is executed, I gives exception:
org.openqa.selenium.NoSuchWindowException: no such window: target window already closed
from unknown error: web view not found
Can someone please help me with this ?
I tried different ways to fix the problem, Removed 'Thread.sleep' and updated browser capabilities as mentioned in this post, but it didn't work:
org.openqa.selenium.WebDriverException: disconnected: received Inspector.detached event error during test execution using Selenium and Chromedriver
I trying to render the webpage using chromedriver on centos7.I have installed both google-chrome and chromedriver .I am starting the chromedriver using the following command.
$ chromedriver --port=9515 --headless --whitelisted-ips="myip" --disable-dev-shm-usage --log-path='chrome.log'
Starting ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29}) on port 9515
Remote connections are allowed by a whitelist (myip).
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
I am running the google chrome using the following command
$ google-chrome --headless --remote-debugging-port=9222 --disable-gpu
xcb_connection_has_error() returned true
DevTools listening on ws://127.0.0.1:9222/devtools/browser/cf6b15dd-0e37-4106-88ed-01b959252da4
Here we have google-chrome and chromedriver running.But when my Java application try to connect to the port at which the chromedriver is running i am getting the following error
java.lang.RuntimeException: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729#{#29}),platform=Linux 3.10.0-862.3.2.el7.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
I have tried out the same in my windows environment it works fine.
version:
ChromeDriver 74.0.3729.6
Google Chrome 74.0.3729.131
I am using ChromeDriver v2.24 and I have Chrome browser 52 in my system (not installed, executable file).
When I am executing my selenium script, the Chrome Driver is getting executed, but the Chrome browser is not getting launched. Because of that, I am getting
NoSuchSessionException: no such session
Console:
Starting ChromeDriver 2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf) on port 27796
Only local connections are allowed.
Jun 02, 2017 11:17:46 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
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.
Note: My script was working fine when I was using ChromeDriver 3.1 and Chrome 58 before the Windows security update. Post update I am not able to launch the Chrome browser as it's not launching the browser but running in the background.
Here is the Answer to your Question:
As the logs depict till INFO: Detected dialect: OSS all was fine with your code.
Next we observe SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". which means the issue is with the loading of the class.
You have mentioned My script was working fine when I was using ChromeDriver 3.1 and Chrome 58 before the Windows security update
So the solution would be to download the latest ChromeDriver 2.29 from here and re-execute your script.
Let me know if this Answers your Question.
You should remove all Chrome browser instances from the system and install Chrome browser v52-54 which is supported by your chromedeirver 2.24.
Without installing a Chrome v52-54 crhomedriver is not able to launch it.
Make sure this is currently installed version and it's not updated automatically when the browser starts. You may need to disable Google Chrome auto update
I am newbie with Selenium. I recently encountered with one failure that I could not overcome.
I am trying to run next suite in firefox or chrome:
C:\auto_tools>java -jar selenium-server-standalone-2.46.0.jar -htmlSuite "*googlechrome C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://google.com" "D:\Selenium_2.0\Selenium_tests\Selenium_IDE&Selenium Builder\Selenium_start\test_suit.html" "D:\Selenium_2.0\Selenium_tests\Selenium_IDE&Selenium Builder\Selenium_start\results.html"
As answer I am see chrome browser with:
http://google.com/selenium-server/core/TestRunner.html?auto=true&multiWindow=true&defaultLogLevel=info&baseUrl=http%3A%2F%2Fgoogle.com&resultsUrl=../postResults&test=http%3A%2F%2Fgoogle.com%2Fselenium-server%2Ftests%2Ftest_suit.html
and
23:02:46.698 INFO - Launching a standalone Selenium Server
23:02:46.825 INFO - Java: Oracle Corporation 25.45-b02 23:02:46.826
INFO - OS: Windows 7 6.1 amd64 23:02:46.838 INFO - v2.46.0, with Core
v2.46.0. Built from revision 87c69e2 23:02:46.897 INFO - Driver class
not found:com.opera.core.systems.OperaDriver 23:02:46.897 INFO -
Driver provider com.opera.core.systems.OperaDriver is not registered
23:02:47.096 INFO - Launching Google Chrome...
with *firefox path/to/firefox.exe - same issue...
Can anyone help please?
Yesterday I found out that the reason was that my antivirus blocked connection to localhost including port 4444 - thats why I could not run test suit.
I've configured the Selenium 2.0 IDE in Firefox and I execute my Project using this IDE.
Execute the Project using IDE.
And i Play back the executed screens.
Saved those Test case in HTML and Java format. (For Java: I used Jnit/Webdriver)
Then i open the java file using eclipse to change for Chrome Driver
After that i append this code into that System.setProperty();
Then i executed the Chromewebdriver using Command Prompt java -Dwebdriver.chrome.driver=/path/to/chromedriver -jar selenium-server-standalone-2.7.0.jar
Then i got the error as
C:\Program Files\Java\jdk1.6.0\bin>java -Dwebdriver.chrome.driver=c:/Users/FSP/D
ownloads/chromedriver.exe -jar selenium-server-standalone-2.39.0.jar
Unable to access jarfile selenium-server-standalone-2.39.0.jar
C:\Program Files\Java\jdk1.6.0\bin>java -Dwebdriver.chrome.driver=c:/Users/FSP/D
ownloads/chromedriver.exe -jar c:/Users/FSP/Downloads/selenium-server-standalone
-2.39.0.jar
Feb 22, 2014 6:48:37 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
18:48:39.395 INFO - Java: Sun Microsystems Inc. 1.6.0-b105
18:48:39.405 INFO - OS: Windows Vista 6.1 x86
18:48:39.618 INFO - v2.39.0, with Core v2.39.0. Built from revision ff23eac
18:48:40.440 INFO - Default driver org.openqa.selenium.iphone.IPhoneDriver regis
tration is skipped: registration capabilities Capabilities [{platform=MAC, brows
erName=iPhone, version=}] does not match with current platform: VISTA
18:48:40.500 INFO - Default driver org.openqa.selenium.iphone.IPhoneDriver regis
tration is skipped: registration capabilities Capabilities [{platform=MAC, brows
erName=iPad, version=}] does not match with current platform: VISTA
18:48:41.089 INFO - RemoteWebDriver instances should connect to:
18:48:41.091 INFO - Version Jetty/5.1.x
18:48:41.122 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
18:48:41.124 INFO - Started HttpContext[/selenium-server,/selenium-server]
18:48:41.125 INFO - Started HttpContext[/,/]
18:48:41.772 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#1db4f6
f
18:48:41.772 INFO - Started HttpContext[/wd,/wd]
18:48:41.799 WARN - Failed to start: SocketListener0#0.0.0.0:4444
Exception in thread "main" org.openqa.jetty.util.MultiException[java.net.SocketE
xception: Unrecognized Windows Sockets error: 0: JVM_Bind]
at org.openqa.jetty.http.HttpServer.doStart(HttpServer.java:696)
at org.openqa.jetty.util.Container.start(Container.java:72)
at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:4
88)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:30
0)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:24
5)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:96)
java.net.SocketException: Unrecognized Windows Sockets error: 0: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.openqa.jetty.util.ThreadedServe`enter code here`r.newServerSocket(ThreadedServer.j
ava:392)
at org.openqa.jetty.util.ThreadedServer.open(ThreadedServer.java:478)
at org.openqa.jetty.util.ThreadedServer.start(ThreadedServer.java:504)
at org.openqa.jetty.http.SocketListener.start(SocketListener.java:202)
at org.openqa.jetty.http.HttpServer.doStart(HttpServer.java:726)
at org.openqa.jetty.util.Container.start(Container.java:72)
at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:4
88)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:30
0)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:24
5)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:96)
C:\Program Files\Java\jdk1.6.0\bin>
How to solve this? So please try to configure and run the script through other browsers using webdriver concept.
It might be classpath issue....
Download the latest version of selenium, say 2.39.0 from the seleniumHQ.org site.
Place it in C:\ drive. Goto the environment variables and add java -jar selenium-server-standalone-2.39.0.jar to the classpath