Code Monkey home page Code Monkey logo

tutum-selenium-grid's Introduction

Running Selenium Grid on Tutum

Deploy to Tutum

Quickly launch a Selenium Grid cluster on Tutum to test your application code in parallel in multiple browsers.

What is Selenium?

Selenium automates browsers. With Selenium, you can easily test your code to make sure you have consistent behavior, from Firefox to Chrome to Internet Explorer. Selenium is also great as part of an integration test suite to ensure your components are working together.

What is Selenium Grid?

Selenium Grid allows for parallel testing with Selenium. You have a central "Hub" which receives requests for tests and routes them to a registered "Node". A Node is configured with certain properties, such as its operating system and browser. When the Hub receives a request for a test with a Linux operating system and a Firefox browser, it will make sure the test is run by the proper Node. This allows for faster, more powerful testing with Selenium.

How to get started

Deploy to Tutum

Sign up for a Tutum account and deploy your first Node Cluster with a tag of selenium. When deploying, I recommend using a Node with at least 1 GB of RAM to handle the Hub and Nodes.

Once your Node Cluster is deployed, hit the Deploy to Tutum button at the top of this Readme. Congratulations! You've deployed a Selenium Grid cluster with two Firefox Nodes and two Chrome Nodes!

View your Hub configuration

Once your Grid is launched, you can check the config at the endpoint of your hub service. To see this, use your browser to visit the endpoint of your hub with a path of /grid/console/.

For example, if my endpoint is hub.selenium.username.svc.tutum.io:4444/, I would point my browser to http://hub.selenium.username.svc.tutum.io:4444/grid/console You should see four browsers listed, two each of Firefox and Chrome.

Run your test!

You'll need to check the documentation for your preferred language. I use Python, and the Selenium documentation for the Python bindings can be found here.

You'll want to instantiate a remote WebDriver that points to your Selenium Hub before calling your tests. Using a modified version of the example in the Python docs here, it would look something like the following:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

driver = webdriver.Remote(
    command_executor='http://hub.selenium.username.svc.tutum.io:4444/wd/hub',
    desired_capabilities=DesiredCapabilities.CHROME)

Be sure to substitute your endpoint in the command_executor line above!

Additional Integrations

Additional Capabilities

Currently, you cannot create a Windows container, so you are limited to testing on Linux operating systems if you want to put your Nodes in Docker containers. However, you can add additional Nodes to your Hub, even if they're not Docker-ized.

Check out Distributed Testing with Selenium Grid to see how to set up Windows and Mac Nodes. You can even run iWebDriver on an iOS device to test application behavior natively on your iPad or iPhone!

Debug Mode

This repo uses images from the Docker selenium GitHub repo. This repo also includes "Debug" Nodes, which allow you to use a VNC client to view your tests running. This can help you understand why your tests are failing.

tutum-selenium-grid's People

Contributors

alexdebrie avatar

Stargazers

Patricio del Sol avatar

Watchers

 avatar

tutum-selenium-grid's Issues

To Selenium tag on nodes

Hey
Love the work.

Just a quick issue. I'm new to Tutum and I don't have a selenium tag on any of my nodes so the deployment fails. I fixed it by taking the tags out of the stackfile. Can you add instructions how to add tags, or maybe take them out and have an 'advanced' instructions section?

I was looking to add a link into https://wiki.jenkins-ci.org/display/JENKINS/Selenium+Axis+Plugin as an easy selenium hub - which does work if you take the tags out

Thanks
Jeremy

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.