Giter Club home page Giter Club logo

selenium-3-setup's Introduction

selenium-3-setup

Maven project to start tests with Selenium Grid.

Set up the testing environment on Ubuntu

Option 1 : Use docker-selenium to set up the testing environment

docker-selenium project on github

  • Get Docker CE for Ubuntu
    • To run docker as a normal user, run this command : sudo usermod -a -G docker $USER and reboot your computer.
  • Install Docker Compose
  • To execute the docker-compose yml file use docker-compose -f composer/docker-compose.yaml up.
    • Add the -d flag at the end for detached execution.
    • To stop the grid and cleanup the created containers, run docker-compose -f composer/docker-compose.yaml down.
  • Scaling up the grid on-demand : docker-compose -f composer/docker-compose.yaml up -d --scale firefox=2 --scale chrome=2.
  • Remote address for the client : http://ipserver:4444/wd/hub (e.g.: http://localhost:4444/wd/hub)
  • http://localhost:4444/grid/console
  • Debugging : to debug your tests you have to use node-chrome-debug and node-firefox-debug (see the composer file). Go to http://localhost:4445/ to list the vnc access. The password is "sercret".
  • You can share files between the host and the containers. It is usefull to upload files in a Web app. See /home/julien/test:/home/seluser/upload in the composer/docker-composer.yaml and adapt to your case. seluser is the user in the containers.
  • You can rename the folder composer in seleniumv3 (for example) if you want to identify easily the containers in the list displayed by http://localhost:4445/
  • If you want to set the timeouts, add GRID_TIMEOUT and GRID_BROWSER_TIMEOUT to the hub in the docker-compose.yaml. To learn more about the timeouts, see also the Grid2 wiki.
    hub:
        image: selenium/hub:3.141.59
        restart: on-failure
        ports:
            - "4444:4444"
        environment:
            - GRID_TIMEOUT=300
            - GRID_BROWSER_TIMEOUT=300

Option 2 : Download and start the selenium-server-standalone.

If you can't use docker, you can use this solution.

Downloads
Start Selenium Grid

hub :

java -jar selenium-server-standalone-3.141.59.jar -role hub

node :

java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register

Launch the tests

mvn test

selenium-3-setup's People

Contributors

julienbreton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.