Protractor error 105 when trying to run spec.js

my protractor was working fine and when updated it it couldnt open a simple spec file it always gives thsi error. I searched for a solution but couldnt find one the conf and spec files are samples from the protractor site itself im pasting the error below hope you could help. Thanks in advance

conf.js error

[09:10:06] E/configParser - error code: 105
[09:10:06] E/configParser - description: failed loading configuration file spec.js

C:\Users\y\AppData\Roaming\npm\node_modules\protractor\built\configParser.js:130

throw new exitCodes_1.ConfigError(logger, 'failed loading configurat
ion file ' + filename);
            ^
Error
    at ConfigError.ProtractorError (C:\Users\y\AppData\Roaming\npm\node_modules\protractor\built\exitCodes.js:10:22)
    at new ConfigError (C:\Users\y\AppData\Roaming\npm\node_modules\protractor\built\exitCodes.js:26:16)
    at ConfigParser.addFileConfig (C:\Users\y\AppData\Roaming\npm\node_modules\protractor\built\configParser.js:130:19)
    at Object.initFn [as init] (C:\Users\y\AppData\Roaming\npm\node_modules\protractor\built\launcher.js:94:22)
    at Object.<anonymous> (C:\Users\y\AppData\Roaming\npm\node_modules\protractor\built\cli.js:130:10)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

The conf and spec files are the sample ones from the site

conf.js:

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

spec.js

describe('Protractor Demo App', function() {
  it('should have a title', function() {
    browser.get('http://juliemr.github.io/protractor-demo/');

    expect(browser.getTitle()).toEqual('Super Calculator');
  });
});

Per @jtzero's remark, the issue lies with the configuration parser masking the actual error message when loading the configuration file.

Depending on whether you run Protractor as global or from the folder, open up (C:\Users\y\AppData\Roaming\npm\)node_modules\protractor\built\configParser.js at line 13‌​0. There you can add logger.error(e); e.g:

    /**
     * Public function specialized towards merging in a file's config
     *
     * @public
     * @param {String} filename
     */
    ConfigParser.prototype.addFileConfig = function (filename) {
        if (!filename) {
            return this;
        }
        var filePath = path.resolve(process.cwd(), filename);
        var fileConfig;
        try {
            fileConfig = require(filePath).config;
        }
        catch (e) {
            logger.error(e);
            throw new exitCodes_1.ConfigError(logger, 'failed loading configuration file ' + filename);
        }
        if (!fileConfig) {
            throw new exitCodes_1.ConfigError(logger, 'configuration file ' + filename + ' did not export a config object');
        }
        fileConfig.configDir = path.dirname(filePath);
        this.addConfig_(fileConfig, fileConfig.configDir);
        return this;
    };

This will then report the error in the output. In my case it was a failing call to require():

[10:36:29] E/configParser - { [Error: Cannot find module 'phantomjs'] code: 'MODULE_NOT_FOUND' }

Repored GitHub issue #3301: https://github.com/angular/protractor/issues/3301

Update Protractor 4.0 will include a fix for this problem to report the masked error message with a stack trace.

failed loading configuration file protractor.conf.js ( Protractor , occurs when I tried to run the test [12:29:41] E/configParser - Error code: 105 spec.js: describe('Protractor Demo App', function(){ it('test tile', function() { I'm new to protractor, i'm trying to run the protractor scripts through Eclipse IDE. I'm seeing the same issue. [11:20:09] E/configParser - [SyntaxError: Unexpected token class]

You should be running the conf.js file, not the spec.js file.

It looks like you are running the command "protractor spec.js" when it should be "protractor conf.js". The error says it is looking for a configuration file but you are passing it a spec file.

Protractor : How to resolve "failed loading configuration file conf.js , It looks like you're trying to run this from your user's home directory and not a project 'jasmine', seleniumAddress: 'https://localhost:4444/wd/hub', specs: ['​spec.js'], } Automation>protractor config.js [17:53:50] E/configParser - Error code: 105  I am trying to add cucumber-protractor-steps to a cucumber-protractor-selenium docker image. For some reason it cannot load the module when I run the project. Copy link Quote reply

Passing correct path to conf.js file can be a solution. Try to navigate to folder, in which you have this file and then launch the command again.

Of course, point at conf.js file, not spec.

Protractor error 105 when trying to run spec.js -, my protractor working fine , when updated it couldnt open simple spec file gives thsi error. searched solution couldnt find 1 conf , spec files  There were some problems with you config file and tests as well. Here is modified version which works as expected without errors. Pleasr try and provide feedback about the results.

I fixed it by reinstalling no idea how or what was the problem

protractor testing in browserstack where i am getting error code 105.i , protractor testing in browserstack where i am getting error code 105.i cant find whats Pattern for finding test spec files specs: ['spec.js'] //allScriptsTimeout: 99999 But while running the test I'm getting the following error(I even tried the same  Hi there! I'm getting a generic "JavaScript error" when trying to run Protractor with Internet Explorer (11) on a Jenkins Slave with Windows Server 2016. When I try to run the tests locally via remote desktop connection on the Windows Se

I had the same problem (with another error code), and fixed adding the java path to the environment variables (SDK installer did'nt configure it automatically).

Working with Spec and Config Files - Protractor, Protractor needs two files to run: the test or spec file and the configuration file. This simple script (example_spec.js) tests the 'The Basics' example on the throw an error if the page it is attempting to load does not contain the Angular library. Error: Cannot find module '/Users/q/conf.js' Seems that you're probably running your protractor CLI command from a directory that the file doesn't exist in. It looks like you're trying to run this from your user's home directory and not a project folder, etc. so I'm a little suspicious based on those paths.

angular/protractor, I got this error in internet explorer alone for chrome and firefox the test I have only one spec as like below @raulovidiu The tests run in Safari, I am able to login and reach the conf.js [16:25:49] E/configParser - Error code: 105 [16:25:​49] I tried outside the exports.config and was also getting an error. Code Explanation of spec.js: describe(‘Protractor Demo Application’, function() The describe syntax is from the Jasmine framework. “describe” (‘Protractor Demo Application’) defines components of an application, which can be a class or function etc., and “Protractor Demo Application” is a string. it syntax is from the Jasmine

failed loading configuration file protractor.conf.js , This exception occurs when I tried to run the test loading configuration file protractor.conf.js [12:29:41] E/configParser - Error: exports.config = { framework : 'jasmine', seleniumAddress : 'http://localhost:4444/wd/hub', specs : ['​EmpCreation.js'], [12:55:03] E/configParser - Error code: 105 [12:55:03] E/​configParser - Error  Jasmine is recommended. framework: 'jasmine', // Spec patterns are relative to the current working directory when // protractor is called. specs: ['first_spec.js'], }; } If you have multiple tests, we can implement the same in Protractor by creating multiple specs files and add these two specs in conf file as below in specs parameter.

Behavior-Driven Angular, [20:24:22] I/launcher - Running 1 instances of WebDriver Jasmine started e2e/​app.e2e-spec.ts import { browser, by, element } from 'protractor'; /protractor/​node_modules/selenium-webdriver/lib/error.js:27:5) at But, as we are performing a „behavior-driven“ approach, let us try to write the tests first. The directConnect solution is nice when running protractor locally, but it didn't work when trying to do it on Jenkins. It seems like when running everything in Docker containers in Jenkins, you'll have to start webdriver-manager start in detached mode -d first, wait, and then start protractor.

Comments
  • Could you post your config (edit the question and include it there)? Thanks.
  • I edited the post im replying in case you didnt check
  • you can open up C:\Users\y\AppData\Roaming\npm\node_modules\protractor\built\configParser.js:130 and in the catch you can put logger.error(e) example: catch (e) { logger.error(e); throw new exitCodes_1.ConfigError(logger, 'failed loading configuration file ' + filename); } should print out something like E/configParser - { [Error: Cannot find module 'ts-node/register'] code: 'MODULE_NOT_FOUND' }
  • The error is saying that it cannot load the file with a module with config. This is working as designed. The error message: E/configParser - description: failed loading configuration file spec. js should be helpful to figure out what's going on. 1. It is a configuration error, 2. It could not load the file. And someone pointed out (below) that you were loading the spec file instead of a configuration file.
  • I explained that i loaded the conf file and it gave that error but now is working fine and im running multiple e2e tests on it
  • Editing the file as you suggested didn't change the log output for me, but it did give me an idea. I opened up node and tried to require() the conf file in the REPL and got the error I was looking for. I was missing a node module.
  • @JoeSkeen Maybe it didn't work because Protractor runs either global or local, and you have to edit the correct one depending on how protractor is executed.
  • @BartVerkoeijen Thx, This hint saved me a LOT of debugging time. I'm still confused, if I should like this "extensibility" in JavaScript.
  • When i start up the conf.js it does the same error il edit it in the post above the changed one
  • Did you run "npm install" in the folder you have those files?