GithubHelp home page GithubHelp logo

selenium-grid-status's Introduction

Selenium Grid Status

A Selenium grid has no public API to get a list of browers attached and available to test with.

This module parses /grid/console and returns a JSON array of the browers that are available.

Install

npm install selenium-grid-status

Usage

var grid = require('selenium-grid-status');

grid.available({
    host: '10.0.1.25',
    port: 1337,
}, function(err, status) {
    if (err) {
        console.log('Error', err);
        process.exit(1);
    }
    console.log(JSON.stringify(status, null, 4));
    console.log('There are', status.configs.length, 'node server available with', status.browsers.length, 'browsers attached and ready');
});

This should print something like this:

{
    [
        "browser": [
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*iexplore",
                "maxInstances": "1"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*googlechrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*googlechrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*googlechrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*googlechrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "Selenium",
                "platform": "MAC",
                "browserName": "*googlechrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "chrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "chrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "chrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "chrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "chrome",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "firefox",
                "maxInstances": "5"
            },
            {
                "seleniumProtocol": "WebDriver",
                "platform": "MAC",
                "browserName": "internet explorer",
                "maxInstances": "1"
            }
        ],
        "configs": [
            {
                "port": "4445",
                "servlets": "[]",
                "host": "192.168.1.33",
                "cleanUpCycle": "5000",
                "browserTimeout": "0",
                "hubHost": "localhost",
                "registerCycle": "5000",
                "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
                "newSessionWaitTimeout": "-1",
                "url": "http",
                "remoteHost": "http",
                "prioritizer": "null",
                "register": "true",
                "throwOnCapabilityNotPresent": "true",
                "nodePolling": "5000",
                "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
                "maxSession": "5",
                "role": "node",
                "jettyMaxThreads": "-1",
                "hubPort": "4444",
                "timeout": "300000"
            }
        ],
    ],[
        "browsers": [
            ...
        ]
    ]
}
There are 1 node server available with 22 browsers attached and ready

selenium-grid-status's People

Contributors

christian-bromann avatar davglass avatar donaldpipowitch avatar gcheung55 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.