question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

protractor 5.1.1 is unable to run test cases in sauce lab but working fine with 5.0.0 / 4 version perfectly

See original GitHub issue

Bug report

  • Node Version: 6.9.1
  • Protractor Version: 5.1.1
  • Angular Version: 1.6.0
  • Browser(s): saucelab chrome
  • Operating System and Version OS X EI captain 10.11.6
  • Your protractor configuration file find below
  • A relevant example test: I was trying to test my test cases in sauce lab after upgrading it to 5.1.1 it did not work, but when I downgrade it to 4/5.0.0 it worked fine. It did not show any error but did not proceed with the tunnel created
  • Output from running the test: attached below
  • Steps to reproduce the bug change the protractor version and will not run
  • The URL you are running your tests against (if relevant) not relevant

configuration ifle:

exports.config = {
  sauceUser: '<userid>',
  sauceKey: '<key>',
  sauceSeleniumAddress: 'localhost:4445/wd/hub',
  //webDriverProxy: '<proxyurl-commented nto required>',
  /*capabilities: {
   'browserName': 'chrome',
   'tunnel-identifier': 'shepherd',
   'build': 'build-12345',
   'name': 'Shepherd DEV functional',
   }*/

  multiCapabilities: [
    {
      'browserName': 'chrome',
      'tunnel-identifier': 'shepherd',
      'build': 'build-12345',
      'name': 'Shepherd DEV functional',
      'chromeOptions': {
        'args': ['--no-sandbox', '--test-type=browser'],
        'prefs': {
          'download': {
            'prompt_for_download': false,
            'default_directory': '/tmp'
          }
        }
      }
      // 'browserName': 'phantomjs',
      // 'phantomjs.binary.path': require('phantomjs-prebuilt').path,
      // 'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG'],
      // 'phantomjs.page.settings.userName': 'tst_dm_adm',
      // 'phantomjs.page.settings.password': 'CAlsGSV#/HNyAX'
    }
  ],
  allScriptsTimeout: 50000,
  seleniumArgs: ['--ignore_ssl'],
  suites: {
    home: 'home/*.spec.js',
    ...
  },
  framework: 'jasmine2',
  jasmineNodeOpts: {
    // If true, print colors to the terminal.
    showColors: true,
    // Default time to wait in ms before a test fails.
    defaultTimeoutInterval: 50000,
    //remove protractor's default dot reporter
    print: function () {
    }
  },
  onPrepare: function () {
    var SpecReporter = require('jasmine-spec-reporter');
    // add jasmine spec reporter
    jasmine.getEnv().addReporter(new SpecReporter({
      displayStacktrace: 'all',
      prefixes: {success: '* ', failure: 'X ', pending: '* '}
    }));

    var jasmineReporters = require('jasmine-reporters');
    jasmine.getEnv().addReporter(
      new jasmineReporters.JUnitXmlReporter(null, true, true, 'testOutput')
    );
  }
};

*** below is the console output after running protractor -c config.js***

C429349HHY3QD:shepherd-test RF886$ ./run-in-saucelab.sh 
Installing..
npm WARN app-tests@0.8.0 No description
npm WARN app-tests@0.8.0 No repository field.
npm WARN app-tests@0.8.0 No license field.
Updating webdriver..
[10:50:54] I/file_manager - creating folder /Users/RF886/aniruddhadas9/develop/herd/jan30/shepherd-test/node_modules/protractor/node_modules/webdriver-manager/selenium
[10:50:55] I/downloader - curl -o /Users/RF886/aniruddhadas9/develop/herd/jan30/shepherd-test/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.15.0.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-macos.tar.gz
[10:50:55] I/update - geckodriver: unzipping geckodriver-v0.15.0.tar.gz
[10:50:55] I/update - geckodriver: setting permissions to 0755 for /Users/RF886/aniruddhadas9/develop/herd/jan30/shepherd-test/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.15.0
[10:50:56] I/downloader - curl -o /Users/RF886/aniruddhadas9/develop/herd/jan30/shepherd-test/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.28.zip https://chromedriver.storage.googleapis.com/2.28/chromedriver_mac64.zip
[10:50:56] I/downloader - curl -o /Users/RF886/aniruddhadas9/develop/herd/jan30/shepherd-test/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.3.1.jar https://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar
[10:50:58] I/update - chromedriver: unzipping chromedriver_2.28.zip
[10:50:58] I/update - chromedriver: setting permissions to 0755 for /Users/RF886/aniruddhadas9/develop/herd/jan30/shepherd-test/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.28
Running tests..
[10:51:00] I/launcher - Running 1 instances of WebDriver
[10:51:00] I/sauce - Using SauceLabs selenium server at https://localhost:4445/wd/hub

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
aniruddhadas9commented, May 31, 2017

The way @wswebcreation mentioned worked for me now. Actually the protractor version 4 and 5 takes configuration in different ways.

if you are using protractor 4 then configure your sauce lab the way I did and if you are using protractor 5 or higher then use protractor config the way @wswebcreation in his post

2reactions
wswebcreationcommented, Apr 2, 2017

@ashubham and @aniruddhadas9

Strange that the tests are failing for you both. I have the following setup and it works:

  • protractor: 5.1.1
  • Node: 6.9.2
  • OSX 10.12.3
  • Sauce Connect 4.4.3 (higher version doesn’t pull up the connection)

Config:

'use strict';
const path = require('path');
const config = require('./protractor.shared.conf').config;

const SAUCE_USERNAME = '<username>';
const SAUCE_ACCESS_KEY = '<key>';

config.baseUrl = `http://localhost:5555`;

config.seleniumAddress = 'http://localhost:4445/wd/hub';

config.multiCapabilities = [
    {
        browserName: 'chrome',
        platform: "Windows 10",
        version: "latest",
        screenResolution: "1400x1050",
        name: '<Name>',
        username: SAUCE_USERNAME,
        accessKey: SAUCE_ACCESS_KEY,
        'tunnel-identifier': '<tunnel-identifier>',
        shardTestFiles: true
    }
];
exports.config = config;

Biggest difference in the configurations is that:

  • I don’t use sauceUser: '<userid>'
  • I don’t use sauceKey: '<key>'
  • I don’t use sauceSeleniumAddress: 'localhost:4445/wd/hub'

Can you check with my configuration if it works? If so we might have an issue with the default connection that we should use of Protractor for Sauce Labs

Grtz

Wim

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot run tests using Protractor and Saucelabs
The solution to my problem was to remove the sauceSeleniumAddress property from the config file. Once I did that my tests started running...
Read more >
CHANGELOG.md
(Previously, this might cause the test failed silently and be reported as ... a Sauce Labs selenium relay (sauceSeleniumAddress in protractor.conf.js) is ...
Read more >
protractor/CHANGELOG.md - UNPKG
202, BREAKING CHANGE: 1) Users will no longer be able to use node versions <4. 2) There is significant. 203, changes to the...
Read more >
Protractor failed to start test with firefox - Stack Overflow
yes i have run webdriver-manager update but still i have this error:E/launcher - Unable to parse new session response:{...} /WebDriverError: ...
Read more >
Sauce connect process not stopping as part of Jenkins pipeline
Hi We have Jenkins setup with no slaves and configured a job with using Jenkins pipeline but after protractor test case execution ends, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found