selenium-grid-status
Fetch available browsers from a Selenium grid
Last updated 5 years ago by davglass .
BSD · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install selenium-grid-status -g
SYNC missed versions from official npm registry.

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',
}, 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:

{
    [
        "browsers": [
            {
                "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

Current Tags

  • 0.2.0                                ...           latest (5 years ago)

6 Versions

  • 0.2.0                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 9
Last Day 2
Last Week 6
Last Month 11
Dependencies (2)
Dev Dependencies (4)

Copyright 2014 - 2017 © taobao.org |