3

I am using Chrome-latest stable version 61.0.3163.79 Chomedriver 2.31 Selenium 3.4.0 Jenkins and docker

My first run over Jenkins getting error as below:

1.732][INFO]: Done waiting for pending navigations. Status: disconnected: Unable to receive message from renderer [1.732][DEBUG]: DevTools request: http://localhost:12059/json [1.733][DEBUG]: DevTools request failed

Can someone please assist me how can I solve this?

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
tsiva
  • 31
  • 1
  • 3
  • can you add the code you are using. it will give better understading to all of us to help you better – Shubham Jain Sep 06 '17 at 11:59
  • is your code working fine without headless? – Shubham Jain Sep 06 '17 at 12:01
  • Try [**`Mozilla Firefox in Headless Mode`**](https://www.youtube.com/watch?v=PPS89xCgNhk&t=528s) – undetected Selenium Sep 06 '17 at 12:51
  • This is first time we are trying on headless, earlier we are using phantomjs – tsiva Sep 06 '17 at 13:52
  • ` chromeOptions.addArguments(dimension); chromeOptions.addArguments("--disable-gpu"); chromeOptions.addArguments("--no-sandbox"); chromeOptions.addArguments("--headless"); System.setProperty("webdriver.chrome.logfile", "target/chromedriver.log"); ChromeDriverService service = new ChromeDriverService.Builder().withWhitelistedIps("").withVerbose(true).build(); driver = new ChromeDriver(service, chromeOptions); driver.get(domain); ` – tsiva Sep 06 '17 at 13:52
  • we are running this from jenkins – tsiva Sep 06 '17 at 13:56

1 Answers1

0
chromeOptions.addArguments(dimension);
    chromeOptions.addArguments("--disable-gpu");
    chromeOptions.addArguments("--no-sandbox");
    chromeOptions.setBinary("/usr/bin/google-chrome");
    System.setProperty("webdriver.chrome.driver", "/usr/local/bin/chromedriver");
    Logger.getLogger("org.openqa.selenium.remote").setLevel(Level.OFF);
    System.setProperty("webdriver.chrome.logfile", "target/chromedriver.log");
    ChromeDriverService service =
            new ChromeDriverService.Builder().withWhitelistedIps("").withVerbose(true).build();
    driver = new ChromeDriver(service, chromeOptions);
    driver.get(domain);

also mount volumes on server: /dev/shm:/dev/shm

This fixed my issue

tsiva
  • 31
  • 1
  • 3