Hot questions for Using Ubuntu in selenium chromedriver

Top Java Programmings / Ubuntu / selenium chromedriver

Question:

I am trying to run automated tests using Selenium Webdriver and webdrivermanager (bonigarcia). I am using Ubuntu + IntelliJ Idea. For Firefox, driver is starting without any issues. For Chrome I get the information:

selenium webdriver failed to load extension from . manifest file is missing or unreadable

I am not getting any name of this extension here, so no idea what is the problem.

I already tried to uninstall, clear all caches, try on a different PC, etc.

thanks!


Answer:

Try to update chrome latest and bonigracia 3.4.0

Question:

I have started hub and node like this:

#!/bin/bash
java -jar /opt/selenium/selenium-server-standalone-3.7.1.jar -role hub &
java -jar /opt/selenium/selenium-server-standalone-3.7.1.jar -role webdriver -hub http://192.168.40.40:4444/grid/register -nodeConfig /opt/selenium/defaultNodeConfig.json -browser "browserName=chrome,platform=LINUX" &

and this is my /opt/selenium/defaultNodeConfig.json:

{
    "capabilities": [
        {
            "browserName": "firefox",
            "platform": "LINUX",
            "maxInstances": 5,
            "cleanSession": true,
            "webdriver.gecko.driver": "/opt/selenium/geckodriver",
            "webdriver.firefox.bin": "/usr/bin/firefox"
        },
        {
            "browserName": "chrome",
            "platform": "LINUX",
            "maxInstances": 5,
            "webdriver.chrome.driver": "/opt/selenium/chromedriver"
        }
    ]
}

When I start Selenium client to connect to hub like this:

#!/bin/bash
java -cp ".:/opt/selenium/client-combined-3.5.3-nodeps.jar:/opt/selenium/selenium-server-standalone-3.7.1.jar" de.auticon.selenium_server.Grid_SetUp

with Grid_SetUp.java being:

package de.auticon.selenium_server;

import org.openqa.selenium.WebDriver;    
import org.openqa.selenium.remote.DesiredCapabilities;    
import org.openqa.selenium.remote.RemoteWebDriver;
import java.net.MalformedURLException;
import java.net.URL;

public class Grid_SetUp {

    public static WebDriver driver;

    public static void main(String[]  args) throws MalformedURLException, InterruptedException{
            System.setProperty("webdriver.chrome.driver","/opt/selenium/chromedriver");

        String URL = "http://www.google.com";    
        String Node = "http://192.168.40.40:4444/wd/hub";    
        DesiredCapabilities cap = DesiredCapabilities.chrome();
        driver = new RemoteWebDriver(new URL(Node), cap);
        driver.navigate().to(URL);    
        Thread.sleep(5000);    
        driver.quit();    
    }       

}

I get the error:

leder@leder-VirtualBox:~/Source/SeleniumCheese/bin$ ./execute_grid.sh Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new service: ChromeDriverService Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z' System info: host: 'leder-VirtualBox', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.8.0-59-generic', java.version: '1.8.0_131' Driver info: driver.version: unknown

Connecting with the same java client to the same java hub and node on windows works fine!

Is there something wrong with my chromedriver_linux64 integration in ubuntu?


Answer:

I additionally had to use java option -D like this for chromedriver:

java -Dwebdriver.chrome.driver=/opt/selenium/chromedriver -jar /opt/selenium/selenium-server-standalone-3.7.1.jar -role webdriver -hub http://192.168.40.40:4444/grid/register -nodeConfig /opt/selenium/defaultNodeConfig.json -browser "browserName=chrome,platform=LINUX" &