Home Tech Full Video: How you perform cross browser testing in protractor
Full Video: How you perform cross browser testing in protractor

Full Video: How you perform cross browser testing in protractor

0

How you perform cross browser testing in protractor. Click here to watch it free.

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

How you perform cross browser testing in protractor

  1. Step 1: Installation of Node.js. You need to install npm for Node. …
  2. Step 2: Installation of Protractor using npm. …
  3. Step 3: Update WebDriver Manager and Start Up A Server. …
  4. Step 4: Installation of Visual Studio Code.

How you perform cross browser testing in protractor

How you perform cross browser testing in protractor

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 : ‘1024×768’, // 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

 

tags:
Hausa.info We gather all the latest news and Special Interest in today Africa. Enjoy all the excitement in reading the best Articles.