Encountering a glitch upon launching Selenium with chromedriver on Debian 8

I am attempting to utilize Selenium with Google Chrome. It is functioning perfectly on my personal computer, but I am encountering issues when trying to run it on my Debian 8 64-bit server. The following error message appears:

root@vps:/opt/SupportBot# java -jar /opt/web/googletest.jar
Starting ChromeDriver 2.34.522913 (36222509aa6e819815938cbf2709b4849735537c) on port 14684
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 2.6.32-042stab127.2 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 147 milliseconds
Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:14.666Z'
System info: host: 'vps.server.com', ip: 'X.XXX.XXX.XXX', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-042stab127.2', java.version: '1.8.0_151'
Driver info: driver.version: ChromeDriver
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        ...

The code I am using for both my Windows PC and Debian 8 server can be found here: https://pastebin.com/auyNbi28

Software Used: - Selenium version 3.8.1 - ChromeDriver 2.34 - Debian 8

Update: With C-Otto's help, I have made progress! I discovered that the issue was due to Chrome not being installed. However, I am now encountering this error repeatedly:

Starting ChromeDriver 2.34.522913 (36222509aa6e819815938cbf2709b4849735537c) on port 2783 Only local connections are allowed. [0.748][SEVERE]: CreatePlatformSocket() returned an error, errno=97: Address family not supported by protocol (97)

Answer №1

The initial issue that you encountered was :

sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

This error could be due to any of the following reasons :

  • java.lang.RuntimeException: exception in constructor
  • java.lang.reflect.InvocationTargetException
  • java.lang.IllegalArgumentException

You can explore a detailed discussion on these points in this Answer.

The second issue you were facing is :

[SEVERE]: CreatePlatformSocket() returned an error, errno=97: Address family not supported by protocol (97)

Mis-configuration in the /etc/hosts file is often the reason for this error. Verify that the entries in /etc/hosts are correct as shown below :

....
---   127.0.0.1       localhost.domain               localhost
+++   127.0.0.1       localhost               localhost

Typically, CreatePlatformSocket() errors stem from IPv6 probing in host_resolver_impl.cc.

Issue#700347 clearly states that Chrome doesn't support Linux kernels without IPv6 support. Refer to a list of supported Linux distributions under See system requirements here: https://support.google.com/chrome/answer/95346?hl=en&ref_topic=3227046

This crash has been reported to Chromium and is being monitored here.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Limit access to the webpage to only one user at any given time

There are two users: X and Y, and one page called Page Z. In order to access Page Z, there is a link available. If Page Z is already open in user X's browser, I need the link to be disabled and deny access to user Y. What is the best way to achieve ...

Converting a byte array to an image file using PHP

After receiving a JPEG byte array from Java SDK, I need to display that image using PHP. Is there a way to convert the byte array into a readable JPEG format for displaying it on a webpage? $byteArray = "[A@53d9e469"; //example of Java generated byte arr ...

What occurs in the event that PayPal's IPN service is unable to reach the IPN destination?

While developing an IPN receiver in Java for processing automatic IPNs, a question arose regarding notification guarantees. The software is currently built in Java and the IPN processor within my project aims to streamline processes by eliminating the need ...

How can 'define' in PHP be translated to Java?

In my code, I am attempting to create a definition, however Java does not have the define function that I need. ...

Struggling with issues during the testing of your Yii application on Selenium?

I am currently using selenium-server-standalone-2.44.0.jar to conduct tests on my Yii application. When I run it in the console without any parameters: java -jar selenium-server-standalone-2.44.0.jar I encounter a few issues: Firefox hangs.In the c ...

Visitor capacity for the website has been restricted

I have created a website that I want only individuals with a license to access. I am wondering how I can restrict each license to a certain number of nodes, meaning the number of visitors allowed. For example: A person with a license for 2 visitors should ...

Interfacing with a PHP script hosted on my server through Java programming

In order to securely access my database, I am looking to utilize a PHP script instead of directly accessing it with Java. This way, I can avoid having the username and password for a read-write account stored in my Java code, which could potentially lead t ...

There was an issue with parsing the data due to a JSONException stating that the value of type java.lang.String cannot be converted

I've been encountering an error while working with PHP, MySQL, and JSON for the past two days. Here are the snippets of my code: require "includes/connexion.php"; $requete="SELECT * FROM contacts;"; $rep=$pdo->query($requete); while($data=$rep-&g ...

Launching a new tab in Google Chrome using Selenium for Facebook login with PHP WebDriver

Hey there! I'm diving into the world of Selenium using Facebook's PHP Webdriver and feeling a bit lost. I've been trying to figure out how to open a new tab in Chrome with this technology, but haven't had any luck. Any insights or tips ...

What is the best way to generate a JSON object in an Android project by merging data from various tables in a MySQL database?

I need help converting the results of my API to a JSON Object using JAVA. Can someone provide guidance on how to achieve this? $sql1="SELECT s.* , c.*,u.* FROM schedule_ s,course_t c, u user_t WHERE c.course_crn=p.course_crn and s.teache ...

Retrieving JSONP using PHP does not yield results, only an object

Received JSONP response from an external domain: jQuery183012824459988766945_1354016515353([{"ID":"X1122","LName":"Smith","FName":"John"},{"ID":"X770","LName":"Johnson","FName":"Amy"}, {"ID":"X994", "LName": "Williams", "FName": "David"}, {"ID": "X580" , ...

Import a large JSON file into either a MySQL or Oracle database

My team at work is responsible for supplying files to other services. These files typically range in size from 5MB to 500MB. We are considering using JSON instead of XML, but I am concerned about how our customers will be able to upload these files into th ...

The functionality of Selenium is not supported on Firefox 57 when using php

After installing Selenium Server Standalone 3.9.1, XAMPP 3.2.2, php-webdriver 0.9.1, and Firefox 57, I attempted to execute the example.php file located in the root of the selenium folder. The code snippet is as follows: require_once "phpwebdriver/WebDriv ...

How does Java compare to PHP's list() function when it comes to accessing variables in an array?

How can you achieve a similar functionality to PHP's list() function in Java? Consider the following example: $matches = array('12', 'watt'); list($value, $unit) = $matches; ...

The action cannot be executed with more than one method argument specified

Whenever I try to utilize one of the standard PHPUnit Selenium assertions, the test fails and an error message is displayed: Error: Command cannot have multiple method arguments. The correct usage according to is: void assertElementValueEquals(string $ ...

The error message displayed in Andriod Studio states that there is an issue converting the value "<br" of type java.lang.String to a JSONObject,

I am currently in the process of developing an android app using Android Studio that involves sending data from a User Registration activity to a database. The goal is for the user to input all the required information, click the register button, and have ...

Encountered an issue with JSON parsing: Expected an array but received a string at line 1, column 1 while transferring data from PHP

I am facing an issue with my code. I need to extract values from a PHP script that encodes a JSON array; My PHP code : <?php $roro = array(); $roro[] = array( 'id' => '1', 'title' => 'title1' ...

Behat Mink fails to locate file during upload submission

I'm currently testing image uploads using Selenium/Mink with Behat in a Symfony application running within a Docker container. Instead of using $driver->attachFileToField('#id-of-input', $filePath), I am attaching the file directly to th ...

Unable to locate the addEventListener function when utilizing php webdriver and selenium

I have been working with the webdriver for just three weeks now, and I've come across an issue regarding finding addEventListener. My setup includes using the selenium standalone server in combination with a PHP framework developed by Facebook. My g ...

When writing to a PHP socket followed by reading, the socket becomes blocked

One issue I am facing is having a Java server listening to requests while a PHP page is sending those requests. After connecting to the server, I use the "socket_write" command to send something, and then attempt to read the server's response with "s ...