Launching Selenium Webdriver Server using Gulp & Protractor - Codoid
Select Page
Codoid Blog

Launching Selenium Webdriver Server using Gulp & Protractor

Irrespective of the business that your client is in, marketing is an integral part of their operations. In fact, in this day and age of social.

Writing automated acceptance tests using Jasmine, Protractor & Gulp is very popular. In this blog post, you will learn how to launch Selenium Webdriver Server automatically using Gulp Protractor without using seleniumServerJar and seleniumAddress in Protractor configuration file.

Protractor & Gulp

Protractor Configuration File

In Protractor configuration file, don’t add seleniumAddress and seleniumAddress

exports.config = {
    // Capabilities to be passed to the webdriver instance.
    capabilities: {
        'browserName': 'chrome'
    },

    // Framework to use. Jasmine is recommended.
    framework: 'jasmine',

    specs: ['todo-spec.js'],

    jasmineNodeOpts: {
        defaultTimeoutInterval: 30000
    }
};  
Gulpfile.js
var gulp = require('gulp');
var protractor = require("gulp-protractor").protractor;

gulp.task("execute",function () {
        return gulp.src([])
            .pipe(protractor({
                configFile: "conf.js"
            }))
            .on('error', function(e) { throw e })
    }
);  

Now you can run your Gulp task without starting or configuring in conf.js.

Written By

Submit a Comment

Your email address will not be published. Required fields are marked *


Writing automated acceptance tests using Jasmine, Protractor & Gulp is very popular. In this blog post, you will learn how to launch Selenium Webdriver Server automatically using Gulp Protractor without using seleniumServerJar and seleniumAddress in Protractor configuration file.

Protractor & Gulp

Protractor Configuration File

In Protractor configuration file, don’t add seleniumAddress and seleniumAddress

exports.config = {
    // Capabilities to be passed to the webdriver instance.
    capabilities: {
        'browserName': 'chrome'
    },

    // Framework to use. Jasmine is recommended.
    framework: 'jasmine',

    specs: ['todo-spec.js'],

    jasmineNodeOpts: {
        defaultTimeoutInterval: 30000
    }
};  
Gulpfile.js
var gulp = require('gulp');
var protractor = require("gulp-protractor").protractor;

gulp.task("execute",function () {
        return gulp.src([])
            .pipe(protractor({
                configFile: "conf.js"
            }))
            .on('error', function(e) { throw e })
    }
);  

Now you can run your Gulp task without starting or configuring in conf.js.