Git Product home page Git Product logo

Comments (18)

surenr avatar surenr commented on September 24, 2024 2

Have you done a npm install after cloning the project? error seems to suggest the protractor module can't be found.

from codespecjs.

sparsh13h avatar sparsh13h commented on September 24, 2024 2

@Shabbir124 : I was facing the same error . While saving conf.js we need to add "conf.js" so as to make the file as javascript file else it will take it as a text file only. So just save conf.js file as "conf.js" and similarly spec file also and it will work.

from codespecjs.

sandali1991 avatar sandali1991 commented on September 24, 2024

I also got that issue. After i install npm, it worked 😄 . Thanks @surenr

from codespecjs.

007muditha avatar 007muditha commented on September 24, 2024

@surenr
Thank you for the update :) Will check on that

from codespecjs.

Shabbir124 avatar Shabbir124 commented on September 24, 2024

Error message: failed loading configuration file conf.js
may i know the solution of this problem? :(

from codespecjs.

mogwaipr avatar mogwaipr commented on September 24, 2024

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.

from codespecjs.

alessandrocode09 avatar alessandrocode09 commented on September 24, 2024

I have the same issue, but i don't know the solution, somebody can help me ?

conf.js:

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

spec.js:
describe('Protractor Demo App', function(){
it('test tile', function() {
browser.get('http://demo.redmine.org/');
});
});

When a run this line "protractor conf.js" i have this issue:

[13:52:11] E/configParser - Error code: 105
[13:52:11] E/configParser - Error message: failed loading configuration file conf.js
[13:52:11] E/configParser - C:\Users\User\Documents\Projects\projectProtactor\conf.js:1
(function (exports, require, module, __filename, __dirname) { ��e
^

SyntaxError: Invalid or unexpected token
at new Script (vm.js:83:7)
at createScript (vm.js:267:10)
at Object.runInThisContext (vm.js:319:10)
at Module._compile (internal/modules/cjs/loader.js:686:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:659:17)
at require (internal/modules/cjs/helpers.js:22:18)

Somebody can help me please ?

Protractor version "5.4.2"

from codespecjs.

Mypaal7 avatar Mypaal7 commented on September 24, 2024

I too facing the same issues when only try to create an instance of module/page in the 'beforeLaunch' hook in the config.ts file. If commented the 'beforeLaunch' code it is working as expected, below is my config.ts file looks -

config.ts

import { ProtractorBrowser, Config } from 'protractor';
import {reportingServiceAPIs} from './src/pages/reportingService/reportingServiceAPIs'
export let config: Config = {
//importing test data JSON files from testData folder

params: {
testData: require('./../src/testData/demoTestData.json'),
apiTestData: require('./../src/testData/reportServiceAPIRequestData.json'),
},

seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
// directConnect:false,//true=local , false=grid
framework: 'jasmine',
specs: [
'./src/testSpec/sample/testspec.2.js'
// './src/testSpec/sample/testspec.3.js'
// './src/testSpec/sample/testDataCreationSpec.js'
// './src/testSpec/sample/properties_ReaderSpec.js'

],
jasmineNodeOpts: {
defaultTimeoutInterval: 90000
},

onPrepare: () => {
console.log(" Started onPrepare ")
let globals = require('protractor');
let browser = globals.browser;
browser.manage().window().maximize();
browser.manage().timeouts().implicitlyWait(5000);
},
beforeLaunch:() => {
console.log("Started beforeLaunch")
let api=new reportingServiceAPIs()
let access_token=api.getToken('xxxxxxxxxxx','xxxxxxxxxxxxx');
console.log("access token from beforeLaunch ====================\n" + access_token)
}
}

Please refer the error -

protractor ./convertedJSFiles/config.js

[17:30:19] E/configParser - Error code: 105
[17:30:19] E/configParser - Error message: failed loading configuration file ./convertedJSFiles/config.js
[17:30:19] E/configParser - TypeError: Cannot read property 'params' of undefined
at Object. (E:\platform2.0\Repos\Final\protomation-suite\convertedJSFiles\src\pages\reportingService\reportingServiceAPIs.js:48:40)

from codespecjs.

Mypaal7 avatar Mypaal7 commented on September 24, 2024

I got to know the issue is, in the confg.js file, there is 'params' block where I pointed to some test JSON files, these are invoked from page-level but if I call from config.js file its kind of ambiguous due to this params block is not functioning correctly.
I passed the params object from config.js to Page-level class it's working, rather than calling from page-level

from codespecjs.

Naveen2226 avatar Naveen2226 commented on September 24, 2024

I am unable to generate reports in protractor

//config.js
var HtmlReporter = require('protractor-html-screenshot-reporter');

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

 onPrepare: function() {
      // Add a screenshot reporter and store screenshots to `/tmp/screnshots`:
      jasmine.getEnv().addReporter(new HtmlReporter({
         baseDirectory: '/tmp/screenshots'
      }));
   }

};

//Error
E:\Core\MyFirstProtractor\src\Day2>protractor config3.js
[12:55:03] E/configParser - Error code: 105
[12:55:03] E/configParser - Error message: failed loading configuration file config3.js
[12:55:03] E/configParser - Error: Cannot find module 'protractor-html-screenshot-reporter'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object. (E:\Core\MyFirstProtractor\src\Day2\config3.js:1:82)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

from codespecjs.

priyanka111111 avatar priyanka111111 commented on September 24, 2024

Somebody, please help I still facing the issue

failed loading configuration file conf.js [18:45:35] E/configParser - ReferenceError: spec1 is not defined

from codespecjs.

mzali1900 avatar mzali1900 commented on September 24, 2024

I am having same issue
Error Code : 105
Error message: failed loading configuration file config.js
Error: cannot find module 'C:\automation-factory-develop\FolderProtractorAutomation\config.js

from codespecjs.

nguyenlehai avatar nguyenlehai commented on September 24, 2024

I'm having same issue:
[10:14:35] E/configParser - Error code: 105
[10:14:35] E/configParser - Error message: failed loading configuration file ./test-config/protractor.conf.js
[10:14:35] E/configParser - Error: EIO: i/o error, read
at Object.fs.readSync (fs.js:675:18)
at tryReadSync (fs.js:540:20)
at Object.fs.readFileSync (fs.js:575:19)
at Object.Module._extensions..js (module.js:663:20)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (C:\HNL\pwa\node_modules\jasmine-spec-reporter\built\spec-reporter.js:6:25)

Have you done a npm install after cloning the project? error seems to suggest the protractor module can't be found.

Still not working !

from codespecjs.

ingriddbritok3 avatar ingriddbritok3 commented on September 24, 2024

I am having the same issue, but just after run the following command:
npm install --save-dev sg-protractor-tools
After this command, I can not run any config file. Does anyone know how to fix or revert this?

from codespecjs.

anshulchhajed avatar anshulchhajed commented on September 24, 2024

Use the below snippet. This worked for me
I jst added missing comma after specs in the script.

var HtmlReporter = require('protractor-beautiful-reporter');

exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['firsttest.js'],

onPrepare: function() {
// Add a screenshot reporter and store screenshots to /tmp/screenshots:
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: 'tmp/screenshots'
}).getJasmine2Reporter());
}
}

from codespecjs.

Umer919 avatar Umer919 commented on September 24, 2024

PS C:\Users\Ahsan\Desktop\Projects> protractor .\conf\conf.js
[00:56:25] E/configParser - Error code: 105
[00:56:25] E/configParser - Error message: failed loading configuration file .\conf\conf.js
[00:56:25] E/configParser - Error: Cannot find module 'C:\Users\Ahsan\Desktop\Projects\conf\conf.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at ConfigParser.addFileConfig (C:\Users\Ahsan\AppData\Roaming\npm\node_modules\protractor\built\configParser.js:135:26)
at Object.initFn [as init] (C:\Users\Ahsan\AppData\Roaming\npm\node_modules\protractor\built\launcher.js:93:22)
at Object. (C:\Users\Ahsan\AppData\Roaming\npm\node_modules\protractor\built\cli.js:227:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
PS C:\Users\Ahsan\Desktop\Projects>

I am Having the Same Issue ,someone please suggest me the solution

from codespecjs.

sensay9 avatar sensay9 commented on September 24, 2024

In my case, I had a freshly installed node which made the existing protractor project causing this type of errors. To fix this issue, I had to install npm with npm install npm@latest -g and then ** webdriver-manager update** command to update the driver.

from codespecjs.

Shaveta872 avatar Shaveta872 commented on September 24, 2024

Solution for protractor screenshot issue
Installed globally

npm install -g protractor-jasmine2-html-reporter

Run below command to link protractor and jasmine2-html-reporter to aovid report not generating issue. Please see Girish Sortur's answer in How to create Protractor reports with Jasmine2

npm link protractor-jasmine2-html-reporter

Also add this import with path to exact node module to avoid the error in windows 10

var Jasmine2HtmlReporter = require('C:/Users/sam/AppData/Roaming/npm/node_modules/protractor-

var Jasmine2HtmlReporter = require('C:/Users/sam/AppData/Roaming/npm/node_modules/protractor-jasmine2-html-reporter');

exports.config = {
framework: 'jasmine',

capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [ "--start-maximized" ]
}
},

  onPrepare: function() {
      jasmine.getEnv().addReporter(
        new Jasmine2HtmlReporter({
       takeScreenshots: true,// By default this is enabled Default is true
       takeScreenshotsOnlyOnFailures: false, // Default is false (So screenshots are always generated)
       cleanDestination: true, // if false, will not delete the reports or screenshots before each test run.Default is true
       showPassed: true,//default is true This option, if false, will show only failures.
       fileName: 'MyRepoDemo', //We can give a prefered file name .
       savePath: 'myproreports',//Reports location it will automatically generated
       screenshotsFolder: 'screenshotsloc' //Screenshot location it will create a folder inside myproreports
        })
      );
   },

from codespecjs.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.