seconf2015 docker selenium

191ffa944ba57e72bfe49ff2b7fedde6?s=47 marekj
September 09, 2015

seconf2015 docker selenium

Talk, demo at Selenium Conf 2015, Portland, OR
https://www.youtube.com/watch?v=S4OkrnFb-YY

How do I build a better Selenium Grid with Docker

191ffa944ba57e72bfe49ff2b7fedde6?s=128

marekj

September 09, 2015
Tweet

Transcript

  1. 1.

    How do I build a better selenium grid with docker

    ? @rubytester, Marek Jastrzebski, HomeAway.com 1 Selenium Conf 2015 Talk on YouTube
 https://www.youtube.com/watch?v=S4OkrnFb-YY
  2. 3.

    defines selenium docker image • What's inside the image? Everything

    you need to run Selenium Grid or Standalone • Dockerfile instructions to install java, selenium jar, browsers; chrome or firefox, chromedriver etc... • optionally VNC for visual debugging 3
  3. 6.

    Next 30 minutes • I will demonstrate building a selenium

    grid • on a local machine • and in the cloud • I will share how we use docker-selenium at HomeAway 6
  4. 7.

    7

  5. 8.

    8

  6. 10.

    selenium/standalone-firefox-debug 10 docker run -d --name se \ -p 5900:5900

    -p 4444:4444 \ selenium/standalone-firefox-debug open vnc://:secret@192.168.99.100:5900
  7. 13.

    13 Build, Ship, Run "package an application with all of

    its dependencies into a standardized unit..." Use Dockerfile instructions to build an image
  8. 14.

    14 Build, Ship, Run push to registry public registry =>

    http//hub.docker.com/r/selenium pull image to a any docker capable machine
  9. 15.

    15 Build, Ship, Run "Docker containers wrap up a piece

    of software in a complete filesystem that contains everything it needs to run" "it will always run the same, regardless of the environment it is running in"
  10. 21.

    21

  11. 23.

    docker pull 23 $ docker pull selenium/hub $ docker pull

    selenium/node-chrome $ docker pull selenium/node-firefox
  12. 25.

    docker run 25 docker run -d -P \
 --name hub

    selenium/hub docker run -d --link hub:hub -P \
 --name chrome selenium/node-chrome docker run -d --link hub:hub -P \
 --name firefox selenium/node-firefox
  13. 26.

    docker ps 26 $ docker ps
 CONTAINER ID IMAGE
 20f34a725460

    selenium/node-firefox:latest
 ba7f45e572fe selenium/node-chrome:latest
 07caeeafeb92 selenium/hub:latest
  14. 31.

    Demo: Selenium Grid in the cloud • Using digitialocean as

    an example. • We'll start two machines: • ocean1: for host a hub • ocean2: for host a node 31
  15. 32.

    docker-machine • it lets you create docker hosts on your

    computer or on cloud providers • it configures docker client to talk to them. • once you create a docker host you can manage it. start, stop, upgrade or remove. 32
  16. 33.

    33

  17. 34.
  18. 36.

    start the hub on ocean1 36 http://104.131.4.3:4444/grid/console docker  run  -­‐d

     -­‐-­‐name  hub  -­‐p  4444:4444  selenium/hub  
  19. 37.

    node-firefox on ocean2 37 docker  run  -­‐d  -­‐-­‐name  firefox  -­‐p

     5555:5555  \   -­‐e  REMOTE_HOST=http://45.55.58.67:5555  \   -­‐e  HUB_PORT_4444_TCP_ADDR=104.131.4.3  \   -­‐e  HUB_PORT_4444_TCP_PORT=4444  \   selenium/node-­‐firefox  
  20. 38.

    node-chrome on ocean2 38 docker  run  -­‐d  -­‐-­‐name  chrome  -­‐p

     5556:5555  \   -­‐e  REMOTE_HOST=http://45.55.58.67:5556  \   -­‐e  HUB_PORT_4444_TCP_ADDR=104.131.4.3  \   -­‐e  HUB_PORT_4444_TCP_PORT=4444  \   -­‐v  /dev/shm:/dev/shm  \   selenium/node-­‐chrome