0

I am trying to run the selenium suite on linux 64 bit server where stable chrome 76 is installed and facing below error, my code is running fine in my local mac machine

Error

Chrome is Starting ChomePath :/scratchchrome/chromedriver_linux76_68 Feb 27, 2020 5:19:51 AM org.openqa.selenium.remote.DesiredCapabilities chrome INFO: Using new ChromeOptions() is preferred to DesiredCapabilities.chrome() Starting ChromeDriver 76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864}) on port 8638 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by

malicious code. 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.) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'arusprint05', ip: '100.104.104.153', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.35-1902.3.1.el7uek.x86_64', java.version: '1.8.0_222' Driver info: driver.version: ChromeDriver remote stacktrace: #0 0x5612da7d3749

Java code is

        DesiredCapabilities capabilities = DesiredCapabilities.chrome();

            String chromePath=System.getProperty("user.dir")+"/";

            String chromedriverPath = chromePath+PropertyfileConfig.getStringValueFromProperty("chromedriverpath");
            System.out.println("ChomePath :"+chromedriverPath);

            System.setProperty("webdriver.chrome.driver", chromedriverPath);

            ChromeOptions options = new ChromeOptions();
            options.addArguments("--no-sandbox");
            options.addArguments("--disable-dev-shm-usage");
            options.setExperimentalOption("useAutomationExtension", false);
            options.addArguments("--window-size=1920,1080");            
            options.addArguments("--start-maximized");
            options.addArguments("--headless");
            options.setExperimentalOption("useAutomationExtension", false);
        options.addArguments("--disable-gpu");

            capabilities.setCapability("chrome.binary", "<Path to binary>");
            capabilities.setCapability("acceptSslCerts", true);
            capabilities.setCapability("acceptInsecureCerts", true);
            capabilities.setCapability(ChromeOptions.CAPABILITY, options);

            driver = new ChromeDriver(capabilities);
            driver.manage().window().maximize();
            driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
Ram Sahu
  • 7
  • 3

1 Answers1

0

DesiredCapabilities are out off. Try to use ChromeOptions only. Cross check chrombrowser version respective .exe file and path passed in setProperty.

this will help you How to implement chromedriver in selenium in Linux platform

murali selenium
  • 3,847
  • 2
  • 11
  • 20