Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Connection reset by peer when doing getText() on ElementArrayFinder when SELENIUM_PROMISE_MANAGER is false #4693

Open
@pumbox

Description

@pumbox

Test execution interrupts on attempt to run .getText() on ElementArrayFinder
Following error is displayed on attempt to run test with selenium server option:

✖ Given I execute socketException test # src/asyncAwaitProtractor.js:182
WebDriverError: java.net.SocketException: Connection reset by peer (connect failed)

And this, in case of direct connection:

✖ Given I execute socketException test # src/asyncAwaitProtractor.js:182
Error: EPIPE write EPIPE

The issue is not reproducing on Firefox.

  • Node Version: 8.9.4
  • Protractor Version: 5.3.0
  • Angular Version: 1.5.7
  • Browser(s): chrome
  • Operating System and Version Mac OSX

config file

const config = {
    SELENIUM_PROMISE_MANAGER: false,
    baseUrl: "http://www.protractortest.org/#/",
    seleniumAddress: 'http://localhost:4444/wd/hub',
    capabilities: {
        browserName: 'chrome',
        shardTestFiles: false,
        maxInstances: 1
    },
    specs: [
        './features/*.feature'
    ],
    ignoreUncaughtExceptions: true,
    disableChecks: true,
    framework: 'custom',
    frameworkPath: './node_modules/protractor-cucumber-framework',
    restartBrowserBetweenTests: true,
    cucumberOpts: {
        require: './src/*.js',
        strict: true,
        format: 'json:results.json',
        defaultTimeoutInterval: 160000,
        tags: "@socketException"
    },
    onPrepare: onPrepare,
    onComplete: onComplete
};

async function onPrepare() {
    const {Given, Then, When} = require('cucumber');
    global.Given = Given;
    global.When = When;
    global.Then = Then;
}

async function onComplete() {
    console.log("suite tests complete --> ");
}
exports.config = Object.assign({}, config);

package.json

{
  "name": "socketException",
  "version": "1.1.0",
  "dependencies": {
    "protractor": "5.3.0",
    "protractor-cucumber-framework": "4.2.0"
  },
  "devDependencies": {
    "cucumber": "4.0.0"
  }
}

test example

Given("I execute socketException test", async function () {
    let btnsList = () => {return $$("h2")};
    await browser.get(browser.baseUrl);
    console.log(await btnsList().getText());
    console.log(await btnsList().getText());
    console.log(await btnsList().getText());
    console.log(await btnsList().getText());
    console.log(await btnsList().getText());
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions