RobCherry / docker-chromedriver

Docker container for creating ChromeDriver servers
99 stars 74 forks source link

[SEVERE]: Timed out receiving message from renderer #19

Closed msameerbutt closed 4 years ago

msameerbutt commented 5 years ago

I am using Google chrome headless with Selenium in maven following are the details

1) Google Chrome 75.0.3770.100 2) ChromeDriver 75.0.3770.90 3) Selenium 3.141.59

When I run ChromeDriver with following options

ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
driver = new ChromeDriver(options); 
driver.get(prop.getProperty("url"));
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

It successfully executes all the test but also throws following error so this is not my worry [1562587666.889][SEVERE]: bind() failed: Cannot assign requested address (99) Although I have tried different suggestions but nothing seems working.

The real issue is when I set chrome windows size greater than 800,600 it stops working

ChromeOptions options = new ChromeOptions();
options.addArguments("--headless", "--window-size=1920,1080");

and start throwing the following error on each test [SEVERE]: Timed out receiving message from renderer and tests are not executed at all, remove the screen option and its working again.

This is driving me insane, I tried different combination of Chrome, ChromeDriver but no success, Kindly suggest something to resolve this.

Following is my Docker file

FROM maven:3.6.1-jdk-8

# Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
    && apt-get update -qqy \
    && apt-get -qqy install google-chrome-stable \
    && rm /etc/apt/sources.list.d/google-chrome.list \
    && rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
    && sed -i 's/"$HERE\/chrome"/"$HERE\/chrome" --no-sandbox/g' /opt/google/chrome/google-chrome

# ChromeDriver
RUN CHROME_VERSION=$(google-chrome --version | grep -Eo "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,4}") \
    && CHROME_DRIVER_VERSION=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION) \
    && wget --no-verbose -O /tmp/chromedriver_linux64.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
    && rm -rf /opt/chromedriver \
    && unzip /tmp/chromedriver_linux64.zip -d /opt \
    && rm /tmp/chromedriver_linux64.zip \
    && mv /opt/chromedriver /opt/chromedriver-$CHROME_DRIVER_VERSION \
    && chmod 755 /opt/chromedriver-$CHROME_DRIVER_VERSION \
    && chmod +x /opt/chromedriver-$CHROME_DRIVER_VERSION \
    && ln -fs /opt/chromedriver-$CHROME_DRIVER_VERSION /usr/bin/chromedriver    

Thanks

RobCherry commented 5 years ago

First, this issue does not appear related to this repository.

That being said, what command are you using the start your docker container? Have you enable verbose logging to try and determine what is happening? What is the host operating system? Please provide as much information as possible.

msameerbutt commented 5 years ago

Sorry @RobCherry I realize later that its not related to your thread. You can close it if you think. Host Operating System is Mac and I have tested this on Ubuntu both have same issue

I am executing this with docker-compose.yml

version: '3.4'
services:

  # The Application
  app:
    image: ${CONTAINER_REGISTRY_BASE}/app
    build:
      context: ./
      dockerfile: .build/maven/dockerfile
    command: mvn clean verify
    working_dir: /usr/src/mymaven
    tty: true
    volumes:
      - ./PulseV2Automation1:/usr/src/mymaven
    env_file:
      - .env

Thanks for your help and response