Something went wrong with @wdio/runner: unable to establish session

After successfully developing cucumber tests that passed and tested some URLs with Chrome, I encountered errors when uploading to the pipeline despite the tests succeeding. Webdriver generated the following errors:

INFO webdriver: DATA {
57[0-0]   capabilities: {
58[0-0]     alwaysMatch: { browserName: 'chrome', acceptInsecureCerts: true },
59[0-0]     firstMatch: [ {} ]
60[0-0]   },
61[0-0]   desiredCapabilities: { browserName: 'chrome', acceptInsecureCerts: true }
62[0-0] }
ERROR webdriver: RequestError: connect ECONNREFUSED 127.0.0.1:9515
64[0-0]     at ClientRequest.<anonymous> (/builds/zdf-cloud/fitness-functions/node_modules/got/dist/source/core/index.js:962:111)
65[0-0]     at Object.onceWrapper (events.js:418:26)
66[0-0]     at ClientRequest.emit (events.js:323:22)
67[0-0]     at ClientRequest.EventEmitter.emit (domain.js:482:12)
68[0-0]     at ClientRequest.origin.emit (/builds/zdf-cloud/fitness-functions/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
69[0-0]     at Socket.socketErrorListener (_http_client.js:426:9)
70[0-0]     at Socket.emit (events.js:311:20)
71[0-0]     at Socket.EventEmitter.emit (domain.js:482:12)
72[0-0]     at emitErrorNT (internal/streams/destroy.js:92:8)
73[0-0]     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
74[0-0]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
75[0-0] 2022-02-18T10:21:26.227Z ERROR @wdio/runner: Error: Failed to create session.
76[0-0] Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
77[0-0] If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
78[0-0]     at startWebDriverSession (/builds/zdf-cloud/fitness-functions/node_modules/webdriver/build/utils.js:72:15)
79[0-0]     at processTicksAndRejections (internal/process/task_queues.js:97:5)
80[0-0] FAILED in chrome - /src/cucumber/features/www/originCheck.feature
812022-02-18T10:21:26.343Z INFO @wdio/cli:launcher: Run onComplete hook
82Spec Files:    0 passed, 1 failed, 1 total (100% completed) in 00:00:11 
832022-02-18T10:21:26.345Z INFO @wdio/local-runner: Shutting down spawned worker
842022-02-18T10:21:26.596Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
852022-02-18T10:21:26.597Z INFO @wdio/local-runner: shutting down

Despite implementing the configurations recommended on the WebDriver main site and trying various combinations of chromedriverand selenium-standalone settings in wdio.conf.js, the issue persisted:

 capabilities: [{
  
        maxInstances: 5,

        browserName: 'chrome',
        acceptInsecureCerts: true
    }],
    logLevel: 'info',
    
    baseUrl: '',

    waitforTimeout: 10000,
  
    connectionRetryTimeout: 120000,
    
    connectionRetryCount: 3,
   
    services: 
    [
        ['selenium-standalone', { drivers: { firefox: '0.29.1', chrome: true, chromiumedge: 'latest' } }],
    ['chromedriver',
     {
            logFileName: 'wdio-chromedriver.log',
            outputDir: 'driver-logs',
            chromedriverCustomPath: './chromedriver.exe'
    }]
],

Even after trying to downgrade the chromedriver version and changing docker images in the pipeline, the 'Failed to create session.' error persists. Do you have any suggestions on how to resolve this issue and avoid session creation errors when using Chrome with WebDriver?

Answer №1

When using WDIO V7 with selenium standalone version 7.20.3, an issue may arise with the Microsoft Edge browser if the 'browserName' in capabilities is not set correctly. Instead of using 'edge', the correct name should be:

browserName: 'microsoftEdge'

For more information, visit

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

It appears that the font in style.css is not being updated properly and seems to resemble

My issue lies within my CSS code. The text on my website is not displaying correctly and seems to be ignoring the styling that I have applied. Even though I have used similar styling on other buttons which look fine, this specific text element is causing p ...

How can we best optimize the conclusion of an infinite scroll when content is depleted?

Our web application has a feature that automatically loads more content when the bottom of the page is reached. Here's how it works: $window .on('scroll', function () { var $this = $(this) ; if ($this.scrollTop() == $do ...

Introducing an alternative solution for handling tasks linked to the completion of CSS3 animations

In order to incorporate smooth CSS3 animations into my website, I have implemented the animate.css library created by Dan Eden. One particular scenario involves a loading screen that features a fade-out animation. It is crucial for this animation to comple ...

Encountering an issue while fetching data from the server - Unable to access properties of undefined (specifically 'toString')

I have encountered an issue where I am trying to set the default value of a select element to the data received from the server. Despite knowing that user.roleId is not undefined, I am getting an error specifically with the select element. Other input elem ...

Which comes first in AngularJS: ng-include or ng-repeat?

What is the outcome if I have a template containing ng-repeat and include it using ng-include? Will the included template have the completed ng-repeat, or will it be included without the ng-repeat being complete (and then completed after inclusion)? ...

I can't figure out why this form isn't triggering the JS function. I'm attempting to create an autocomplete form field that connects to a MySQL database using a PHP script and AJAX

I am encountering an issue while trying to implement the .autocomplete() function from jQuery UI with a list of usernames fetched from a MySQL database using a PHP script. Strangely, it is not functioning as expected and no errors are being displayed in th ...

Unable to utilize the forEach() function on an array-like object

While I generally know how to use forEach, I recently encountered a situation that left me puzzled. Even after searching online, I couldn't find any new information that could help. I recently started delving into TypeScript due to my work with Angul ...

The issue of why iterating over an array of objects does not function properly in React JS

P.S: I have made some modifications to the code below. Extracting the doctor's value from JSON data, updating the state, and then mapping it to print out the values. Initially, there is only one doctor, but in the future, there could be more than one ...

Retrieving the chosen item from an unordered list using jQuery

Hello, I am currently populating a list using the ul-li HTML tags dynamically. My goal is to retrieve the value of the selected li within the corresponding ul. Despite trying various jQuery methods, I keep getting 'undefined'. Here is how I popul ...

Python does not support running WebDriver

Currently, I am deep into a web scraping project that requires me to extract LinkedIn data using Selenium in Python. After successfully installing Selenium in Python, my next step involved attempting to use the Selenium driver to manage Chrome. However, to ...

Problem with AngularJS function execution - require a delay in executing the second function

I am developing a small utility in AngularJS to manage the shopping cart for users. Here is the code snippet from my cart-service.js file: var myStoreCartService = angular.module("myStoreCartService", []); myStoreCartService.factory('Cart', fu ...

Struggling to display my array data retrieved from the database on my Angular 5 page

I hope everyone is doing well. I am currently facing a problem with retrieving data from Firebase. I have an array within an array and I want to display it in my view, but I am encountering difficulties. Let me share my code and explain what I am trying to ...

Unable to transfer content to clipboard from a Popper element nested within a Dialogue component in Material-UI

If you want to see the bug, try opening this link in Firefox. It almost crashed Chrome :P https://codesandbox.io/s/73z5293391 Click on the OPEN SIMPLE DIALOGUE button. A dialogue will appear, then click on the TOGGLE POPPER button. Now a Popper will be d ...

*ngIf doesn't seem to be functioning as expected compared to other *ngIf directives

Encountering a peculiar issue with my *ngIf related to the isAdmin variable which determines whether the list of users in userList should be displayed or not. Strangely, it seems to behave differently compared to other *ngIf statements within the same comp ...

Is there a way to manipulate the appearance of a scroller using JavaScript?

I'm intrigued by how fellow front-end developers are able to customize the scrollbar shape on a webpage to enhance its appearance. Can anyone guide me on using JavaScript to accomplish this? ...

The Resharper guideline "Function Parameter" doesn't allow the usage of AngularJS service names

I have a question regarding naming conventions in my AngularJS app. Currently, all my service names start with an uppercase character. However, I am facing an issue where service parameters must match the service name, but Resharper's JavaScript "Func ...

Tips for incorporating inline styling into the body element

Can someone help me with adding inline style to the body element using jQuery? I want to set the background color to white (#FFFFFF). Your assistance would be highly appreciated. Thank you! ...

"Transferring cookies from a default browser to selenium webdriver: a step-by-step guide

Currently, I am facing an issue where I need to transfer logins from my cookies to my selenium chrome browser. I have tried some tests without any success. That's why I'm seeking help here. Does anyone know how to move cookies from my default b ...

worldpay implements the useTemplateForm callback function

My experience with implementing worldpay on my one-page Angular app (Angular 1.x) has been mostly positive. I have been using the useTemplateForm() method to generate a credit card form and retrieve a token successfully. However, I have encountered an issu ...

Divide the code into individual components within Angular 2 projects

I currently have 3 Angular 2 projects developed in TypeScript. Each project contains the same models and services. I would like to find a way to integrate these common elements at a global level and connect them with each individual project. Any suggesti ...