Protractor AngularJS Demo

Protractor AngularJS is supported by Gridlastic, run your tests in the cloud at high speed on real browsers. We also support several other node.js frameworks like wd and webdriverio.

The Gridlastic hub endpoint and the video url used in this code example is displayed after launching your Gridlastic selenium grid. See documention Selenium Grid Configuration Parameters where to find these credentials and replace with your own.

Get a free account and launch your Gridlastic selenium grid demo, then run this code locally and test your grid!


Test Script

protractor-example.js


browser.driver.manage().window().maximize(); // If Linux set window size, max 1920x1080, like browser.driver.manage().window().setSize(1920, 1080);

describe('What to do next list', function() {
  it('Build what to do list', function() {
    browser.get('http://www.angularjs.org');
    browser.driver.sleep(5000);
  });
});

browser.getSession().then(function(session) {
console.log("Video: " + VIDEO_URL + session.getId());
});


Configuration

protractor-example-conf.js


exports.config = {
  seleniumAddress: 'https://HUB_SUBDOMAIN.gridlastic.com/wd/hub',
  specs: ['protractor-example.js'],
  capabilities: {
  gridlasticUser: USERNAME,
  gridlasticKey: ACCESS_KEY,
  video: 'True',
  browserName: 'chrome',
  version: 'latest',
  platform: 'WIN10',
  platformName: 'windows'
  }
};
Note: starting from selenium version 3.9.1 you must also include "platformName": "windows" in the request when testing with firefox and IE.

Run Test


protractor protractor-example-conf.js


NOTE: Gridlastic auto scaling requires all 3 test environment parameters platform, browser and browser version to be specified in each request in order to launch test nodes to fulfill test demand. Video recording is optional. See test environments for capabilities options.