Docker grid node xvfb resolution.

759 views
Skip to first unread message

Остап Олексин

unread,
Nov 9, 2015, 9:28:03 AM11/9/15
to Selenium Users
Hi, I'm new to docker and I was wondering, is it possible to start a firefox or chrome node container with a custom xvfb resolution?

Остап Олексин

unread,
Nov 9, 2015, 10:06:45 AM11/9/15
to Selenium Users
Already found the solution myself. You can define the xvfb display resolution by passing SCREEN_WIDTH and SCREEN_HEIGHT variables to the container:
docker run -d -e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 --link selenium-hub:hub selenium/node-firefox 

or just add them to the yml file if you are using docker compose:
firefox:
 
image: selenium/node-firefox
  environment:
    SCREEN_WIDTH: 1920
 
  SCREEN_HEIGHT: 1080



понедельник, 9 ноября 2015 г., 16:28:03 UTC+2 пользователь Остап Олексин написал:

Roy de Kleijn

unread,
Jun 12, 2016, 9:18:17 AM6/12/16
to Selenium Users
for me it doesn't work.. It still see:
System.out.println(driver.manage().window().getSize().getWidth()); // = 1440
System.out.println(driver.manage().window().getSize().getHeight()); // = 810

My docker-compose.yml file look like this:
----------------------------------------
seleniumhub:
  image: selenium/hub
  ports:
    - 4444:4444

firefoxnode:

  image: selenium/node-firefox
  environment:
    SCREEN_WIDTH: 1920
    SCREEN_HEIGHT: 1080
  ports:
    - 5900
  links:
    - seleniumhub:hub
chromenode:
  image: selenium/node-chrome

  environment:
    SCREEN_WIDTH: 1920
    SCREEN_HEIGHT: 1080
  ports:
    - 5900
  links:
    - seleniumhub:hub
---------------------------------------------

Do you have any clue what I need to change?

Roy

Hazel Troost

unread,
Jul 10, 2016, 12:20:01 AM7/10/16
to Selenium Users
You have to use a debug container.

Hazel Troost

unread,
Jul 12, 2016, 11:36:49 AM7/12/16
to Selenium Users
If not using debug container, maximize won't work, but you can set size manually. 
Reply all
Reply to author
Forward
0 new messages