Protractor

Applies to CrossBrowserTesting SaaS, last modified on September 13, 2021

Protractor is a testing system for angular http://angular.github.io/protractor/#/

The setup of protractor tests are driven by the conf.js file. At the gist listed below there is an example conf.js that will work with crossbrowsertesting.com

exports.config = {
  
  // change this to your USERNAME and AUTHKEY
  seleniumAddress: 'http://USERNAME:AUTHKEY@hub.crossbrowsertesting.com:80/wd/hub',

  capabilities : {

    name : 'protractor test', // this will show up in the UI
    
    // these are important :)
    browser_api_name : 'FF31', // change this according to what browser you are using
    os_api_name : 'WinXPSP2-C2', // change this for the OS you are using
    screen_resolution : '1024x768', // change this for the resolution
    
    //
    record_video : false,
    record_network : false,
    record_snapshot : false,

    // change this to your USERNAME and AUTHKEY
    username : "USERNAME",
    password : "AUTHKEY"

  },

  //
  specs: ['todo-spec.js']
};

https://gist.github.com/tonetheman/0982b86eadabccca90e5

The capabilities object needs to include the extra information about which browser and operating system you are going to run on crossbrowsertesting.com. You can get these constants from the example script on the Selenium page.

The other change is you must include your username/authkey in the capabilities object. Those two fields are called username and password respectively.

You can also test more than one browser at a time by using the multicapabilties, see this tutorial on the protractor tutorial.

http://angular.github.io/protractor/#/tutorial

Also see this example of what a conf.js should look like for multicapabilities. https://gist.github.com/tonetheman/5369e5e7f6cbd8d95e41

That example will run firefox32 and firefox31 on WinXPSP2 simultaneously. The simple todo-spec.js is here https://gist.github.com/tonetheman/7b1e4bc9a60377b304e6

See Also

Test Frameworks and Tools
About Selenium Testing
Selenium and JavaScript
CucumberJS
InternJS
Jasmine
Jest
Karma
Mocha
NightwatchJS
WebDriverIO and CrossBrowserTesting

Highlight search results