Rut Jeronimo
Rut Jeronimo

Reputation: 1

not able to run protactor test on chrome driver

enter image description here

So whenever I run my conf.js file the WebDriver instance start but then it timeouts :(. (See image attached)

Chrome not reachable is the result.

My environment is setting this way:

This is my conf.js file

exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub/',
specs: ['./reporting/example.js'],
capabilities: { 
    'browserName': 'chrome', 
    chromeOnly:true ,
    directConnect: true,
    'chromeOptions': {'args': ['show-fps-counter=true']}
},

onPrepare: function(){
    browser.driver.manage().window().setPosition(0.0);
    browser.driver.manage().window().setSize(1280.720);
}

}

Upvotes: 0

Views: 184

Answers (2)

tyaga001
tyaga001

Reputation: 169

Yes agreed directConnect: true in your conf file is in wrong place. it should not include within capabilities tag. it should be placed like below file.

var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
var log4js = require('log4js');


exports.config = {

 //seleniumAddress: 'http://localhost:4444/wd/hub',
  directConnect: true,
  allScriptsTimeout: 11000,
  framework: 'jasmine2',

  onPrepare: function () {

    browser.manage().timeouts().implicitlyWait(11000);
    var width = 768;
    var height = 1366;
    browser.driver.manage().window().setSize(768, 1366);
    //browser.ignoreSynchronization = true

    jasmine.getEnv().addReporter(
      new Jasmine2HtmlReporter({
        savePath: __dirname+'/reports/results/e2e',
        takeScreenshots: false,
        filePrefix: 'report',
        consolidate: true,
        cleanDestination: false,
        consolidateAll: true

      })
    );
  },

  suites:{
    smoke:['./test/e2e/Login/**/*Spec.js']
  },

  capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
      'args': []//
    }
  },

  appenders: [
    {
      "type": "file",
      "filename": "./e2eTestLogs/logfile.log",
      "maxLogSize": 20480,
      "backups": 3,
      "category": "relative-logger"
    }
  ],

  resultJsonOutputFile:'./results.txt',


  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 510000
  }
};

Upvotes: 0

Mezo Istvan
Mezo Istvan

Reputation: 2772

Try it with a more simple protractor conf:

exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub/',
    specs: ['./reporting/example.js'],
    capabilities: { 'browserName': 'chrome' },
    onPrepare: function() {
        browser.driver.manage().window().setPosition(0.0);
        browser.driver.manage().window().setSize(1280.720);
    }
}

You had directConnect: true in your original conf in the wrong place, which could cause problems. That option means protractor bypasses the selenium server, and connects directly to Chrome. If you wish to do that, use this conf file:

exports.config = {
    directConnect: true,
    specs: ['./reporting/example.js'],
    capabilities: { 'browserName': 'chrome' },
    onPrepare: function() {
        browser.driver.manage().window().setPosition(0.0);
        browser.driver.manage().window().setSize(1280.720);
    }
}

Upvotes: 1

Related Questions