tasks/datadriver.js
function(callback) {

                if (tunnel) {
                    return callback(null);
                }

                grunt.log.debug('checking if selenium is running');

                var options = {
                    host: capabilities.host || 'localhost',
                    port: capabilities.port || 4444,
                    path: '/wd/hub/status'
                };

                http.get(options, function() {
                    grunt.log.debug('selenium is running');
                    isSeleniumServerRunning = true;
                    callback(null);
                }).on('error', function() {
                    grunt.log.debug('selenium is not running');
                    callback(null);
                });

            }
function(callback) {

                if (tunnel) {
                    return callback(null);
                }

                grunt.log.debug('checking if selenium is running');

                var options = {
                    host: capabilities.host || 'localhost',
                    port: capabilities.port || 4444,
                    path: '/wd/hub/status'
                };

                http.get(options, function() {
                    grunt.log.debug('selenium is running');
                    isSeleniumServerRunning = true;
                    callback(null);
                }).on('error', function() {
                    grunt.log.debug('selenium is not running');
                    callback(null);
                });

            }
check if selenium server is already running