Search code examples
angularjsnode.jsjasmineprotractorbrowserstack

protractor testing in browserstack where i am getting error code 105.i cant find whats the issue in this


//conf.js
const DEFAULT_TIMEOUT_INTERVAL = 15000;
exports.config = {
    framework: 'jasmine2',
        // Browserstack's selenium server address
    seleniumAddress: 'http://hub-cloud.browserstack.com/wd/hub',
    // Pattern for finding test spec files
  specs: ['spec.js']
    //allScriptsTimeout: 99999
   multiCapabilities: [{
    browserstack.user: 'username',
    browserstack.key: 'secret key',
    browserName: 'iPhone',
    platform: 'MAC',
    device: 'iPhone 6'
  }
  ],


// spec.js
var Url = 'http://hahahaha.com/us-home';
//var local = 'http://localhost:1233/us-home';
var testTargetURL= Url;
describe('Login', function() {

 {      
        browser.get(testTargetURL,4500);
        browser.waitForAngular()
        element(by.model('userId')).sendKeys('username');
        element(by.model('password')).sendKeys('password1');
        element(by.id('login_submit')).click();

            browser.waitForAngular();
            browser.sleep(5000);

        expect(browser.getCurrentUrl()).toMatch(/\/dashboard/);
 }
});

Result:

C:\Users\harivignesh.m\Desktop\test>protractor conf.js
[14:21:08] E/configParser - Error code: 105
[14:21:08] E/configParser - Error message: failed loading configuration file con
f.js
[14:21:08] E/configParser - C:\Users\harivignesh.m\Desktop\test\conf.js:9
   multiCapabilities: [{
   ^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:513:28)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at ConfigParser.addFileConfig (C:\Users\harivignesh.m\AppData\Roaming\npm\no
de_modules\protractor\built\configParser.js:125:26)
    at Object.initFn [as init] (C:\Users\harivignesh.m\AppData\Roaming\npm\node_
modules\protractor\built\launcher.js:93:22)

i am new to this protractor testing and i am getting the same error.help me how to resolve this,or post some sample code here so that it would be easy for me to understand..thanks in advance. Steps followed: npm install -g protractor npm install –g jasmine-reporters npm install -g browserstack-webdriver webdriver-manager update,start


Solution

  • capabilities: {
        'browserName': 'chrome'
    }