2

Im learning the automation testing for angularjs application but im encounter object expected error on line 4 which point to first line of my script.

describe("Homepage", function() {
    it("Navigate to homepage", function(){
        browser.get("http://www.way2automation.com/angularjs-protractor/banking/#/login");
    });
});

exports.config = {
    framework: 'jasmine',
    seleniumAddress: 'http://localhost:4444/wd/hub',
    specs: ['protractor.js'] 
}

enter image description here

Please help. Thanks.

11
  • How are you running the tests? Is there any error in the terminal/console? Commented Jun 21, 2019 at 5:55
  • Im running the test using protractor spec.js. No error on console. Commented Jun 21, 2019 at 6:52
  • Please show the content of file C:\Users\admin\Documents\Protractor\protractor.js Commented Jun 21, 2019 at 7:19
  • Please ensure that you installed protractor correctly Commented Jun 21, 2019 at 7:22
  • The protractor is shows on original thread. Please help. Commented Jun 21, 2019 at 10:11

2 Answers 2

2

I think you should follow step by step :

First, you should create a folder where you put protractor-conf.js and spec files in. You should create originally a file to save protractor config. In my project, the file's name is protractor-conf.js .

Step 1 : Just install npm and protractor in project. Follow link Protractor to install protractor in folder with terminal.

Step 2 : Open protractor-conf.js and write following the link config.js

Step 3 : create spec files and run

Sign up to request clarification or add additional context in comments.

Comments

1
+25

Follow the below steps to run the test successfully.

Step1: create config.js file with below code

// conf.js
exports.config = {
  framework: 'jasmine',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['spec.js'],
  capabilities: {
    browserName: 'chrome'
  }
}

Step2: create the spec.js file with below code

describe("Homepage", function() {
    it("Navigate to homepage", function(){
        browser.get("http://www.way2automation.com/angularjs-protractor/banking/#/login");
    });
});

Step3: Now run protractor config.js from your project location after starting your webdriver in a separate terminal with the command webdriver-manager start

run webdriver-manager update if you get error in starting the webdriver.

Hope it helps you

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.