Protractor need 2 files to run the Automation test case.

  1. Configuration File
  2. Spec File

Let's create the Configuration file first

Create a folder in your D drive Automation

> Inside your Automation folder create a file with the name "conf.js"  

Put this code in your conf.js and save it  [Basic Configuration file]

exports.config = {
  directConnect: true,
  specs: ['first-spec.js']
};

 

Now, let's create the spec file 

> Inside your Automation folder create a file with the name "first-spec.js" 

copy and paste this code in spec file, Save it!

 

describe('Test the Google site', function() {
  it('should open the google', function() {
    browser.get('https://www.google.com/');
}); // end of it block
}); // end of describe block

 

Now, let's run the test!!

Go to command prompt and type > cd D drive / Automation [The path of your automation folder]

d:/Automation protractor conf.js

Click enter and it should open the google site!

 

Hurray! You did it!