2

Unable to run the selenium script while connected to the LAN, however it works fine when connected to the WIFI. I have kept all the proxy settings same. Below is the code:

    String exePath = "/usr/local/bin/chromedriver";
    System.setProperty("webdriver.chrome.driver", exePath);
    WebDriver driver = new ChromeDriver();
    driver.get("https://www.google.com");

OS: Mac 10.11.6 Selenium: 2.53 Also tried with 3.8.1 ChromeDriver: 2.33.2 Chrome: V60. Eclipse Oxygen.

Getting Below mentioned error message:

Starting ChromeDriver 2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 21777
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from disconnected: unable to connect to renderer
(Session info: chrome=60.0.3112.113)
(Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.65 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: '01hw382197', ip: '172.25.155.171', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '9.0.4'
Driver info: org.openqa.selenium.chrome.ChromeDriver
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

The error says it all :

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created exception
from disconnected: unable to connect to renderer
(Session info: chrome=60.0.3112.113)
(Driver info: chromedriver=2.33.506106 (8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.65 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'

The main reason is the binaries you are using are incompatible as :

  • You are using ChromeDriver v2.33 of (2017-10-03)
  • Your Chrome Browser version is 60.x
  • Your Selenium Client version is 2.53.1 of time: '2016-06-30 17:32:46'

So there is a time gap of almost 2 years between the release of Selenium Client v2.53.1 and ChromeDriver v2.33

Solution

  • Upgrade your Selenium Client to recent Selenium v3.9.1 level.
  • Upgrade your ChromeDriver to recent ChromeDriver=2.35 level.
  • As per the Release Notes of ChromeDriver=2.35 upgrade your Chrome Browser to Chrome v62-64 levels.
  • If your base Chrome Browser version is too old uninstall Chrome Browser through Revo Uninstaller and install a recent released GA version of Chrome Browser
  • Run CCleaner tool regularly to wipe off all the OS chores before and after the execution of your Test Suite
  • Execute your Tests

Update

As you mentioned you are unable to run the script while connected to the LAN but works fine when connected to the WIFI you need to ensure the following :

  • Ports used by the WebDriver variants (GeckoDriver / ChromeDriver / IEDriverServer) are not used by any other Software/Services over the LAN.
  • Ports (range of ports) are not blocked by the LAN Admins for specific purpose.
  • Firewall is disabled.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • I understand that I am using the old versions, but it is intentionally done by me. However if this would be a version issue then my script will fail while connecting to WIFI as well, which is not happening in my case. Chrome version I am using 60 so compatible chromedriver is 2.33, – Siddharth Tiwari Feb 16 '18 at 11:06
  • https://stackoverflow.com/questions/48760761/unable-to-launch-chrome-from-selenium-while-using-mac-system/48761606?noredirect=1#comment84524906_48761606 please check in this post, while everything was of latest version, then also I was unable to run it. Please help – Siddharth Tiwari Feb 16 '18 at 11:34
  • Added an update to my answer. Let me know the status. – undetected Selenium Feb 16 '18 at 20:32
  • Thanks for the reply @DebanjanB: 1. How to check whether the ports are not used by any other app in mac? I have tried couple of terminal commands which i found in google but couldn't find any relevant option 2. No ports are blocked, also I have run a command to open all the ports. 3. Firewall is disabled. Please advice what needs to be done next. – Siddharth Tiwari Feb 19 '18 at 08:14