Encountering the SessionNotCreatedException error: Unable to initiate a new session. Response code 500 within the Azure pipeline

After setting up a pipeline in Azure-Devops and configuring a self-hosted agent for the same, I encountered an issue where it opens the browser but fails with a sessionNotCreatedException.

Interestingly, when running the same code using STS or eclipse tool, it runs successfully without any errors.

The error message faced is as follows: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Microsoft Edge failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist) (The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so msedgedriver is assuming that msedge has crashed.)

Answer №1

If you're facing a problem, here are some steps you can try to resolve it:

  1. Add the following arguments to the Edge options in your code:

    • --remote-debugging-port=<port>
    • --headless
  2. Ensure that you specify the correct path for msedgedriver. For example:

    self.driver = webdriver.Edge(executable_path='path/to/msedgedriver')
    
  3. You may have multiple Edge Driver copies running. Search for any redundant Edge Drivers using keywords like "msedgedriver" or "MicrosoftWebDriver" and delete older versions.

  4. To prevent data loss, create a backup of your User Data folder in a new directory before running selenium tests.

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

ElementNotFoundException, Selenium is having trouble finding the element

My first time using Selenium and I'm struggling to locate my TextField element. I've tried using By.id("originTextField"), as well as the xPath and cssSelector provided by Chrome's dev tools. If anyone could provide an explanation, I would ...

Automate the process of logging into Tenable.io by utilizing Selenium with Python

Greetings! I am fairly new to the world of programming and have been encountering an issue while trying to automate credential input on using Selenium with Python. Despite my attempts at research, I have not been able to find a solution thus far. Please f ...

Selenium Edge browser - unable to start session: No suitable capabilities detected

Attempting to execute a Selenium test using Java and the Edge driver, which is based on Chromium. The version of Edge Dev installed on Windows 10 is 83.0.478.37 (Official build dev 64-bit): Selenium Version : 3.141.59 Utilizing webdrivermanager setup fo ...

Can Selenium in JavaScript be used to retrieve child elements from a webpage?

I've been struggling to adapt my JavaScript script for use with Selenium (also in JavaScript). Despite numerous attempts, I haven't been able to find a solution. I've attached an image to better explain my question await chromeDriver.findEle ...

The WebDriver URL Timeout feature appears to be malfunctioning

In the test class of my Java code, I have implemented the following snippet which is supposed to set a timeout of 5 seconds for page loading. However, it doesn't seem to work as expected. Even when tested on slow connections, the page load waits indef ...

Finding checkboxes that have the "checked" attribute: a simple guide

I'm working with a list of checkboxes and trying to identify the ones that have the "checked" attribute. Here's an example of what my checkbox element looks like: <input type="checkbox" class="u-display--inline-block u-margin-right--small" ch ...

After executing my Python code, I receive a result of "NoneType"

I am facing a problem with my code where it returns NoneType when I include .text, and it still returns NoneType even after removing .text in the dataframe. How can I fix this issue? data_adi = [] n=0 for n in range(pagenum): pages_url = f"https:/ ...

Utilizing the power of Python with Selenium Webdriver to effortlessly upload an image onto Google's image

from selenium import webdriver from selenium.webdriver.common.keys import Keys import sys, os from time import sleep class imageSearch(): """ Image search automation using Google reverse image search with Selenium and Python 3.8. Dependencies: ...

Ways to choose a particular radio button from a set of similar radio buttons using Selenium WebDriver

Seeking assistance with automating the booking process on an airline website. On the second page of the booking process ('Select Flights'), there are numerous radio buttons that appear very similar to each other. How can I ensure that I select th ...

The webpage fails to load when using the Selenium driver.get command

Currently utilizing the webdriver-manager for efficient management of chrome drivers in the following manner: # automation with selenium 4 from selenium import webdriver from selenium.webdriver.chrome.service import Service as ChromiumService from webdrive ...

Currently, I am utilizing Selenium-webdriver and require the capability to choose an element based on its textual content

Having an issue with finding an element using the current xpath and need a dynamic solution. public void selectCheckBox(WebElement wrapper, String value) { scrollTo(wrapper); String xpath = ".//label[span/text()='" + value + "& ...

Extracting Dates from a Datepicker using Scrapy and Selenium

Currently, I am working on scraping pages like this or this using Scrapy and Selenium to interact with a datepicker calendar. My main goal is to check the availability of rooms for each day in a given month. To achieve this, I am attempting to click on th ...

Using Selenium in Python to interact with and click a span element

For days, I have been attempting to use Selenium with Python to click on the continue button in the Login Page from the provided link below: Despite trying various selectors like xpath, nothing seems to be working for me. This is the specific element tha ...

Python - ExceptionalInputRequirement

I'm diving into the world of web scraping, but I keep running into roadblocks whenever I attempt to access a URL. Here's the code I'm working with: from selenium import webdriver from selenium.webdriver.common.keys import Keys driver = w ...

The Python Selenium test passes without issue when executed on its own, but encounters a Chromedriver error when included in the defaultTestLoader

While conducting a Selenium Test in Python, I encountered an issue. The test file runs successfully, but when attempting to run a testLoader with that test, an error occurs: selenium.common.exceptions.SessionNotCreatedException: Message: session not create ...

Guide to Executing the Appium Selenium Mobile Automation Script on a Different Machine Remotely from the Primary Code Machine

Is it possible to execute the Appium Mobile automation script from one main/coding machine to another machine that has a connected device? I am interested in learning about the required software and prerequisites for running the code on a different machin ...

Encountering the GDK_BACKEND error that does not correspond to the displays available on Debian

While attempting to execute a headless browser on a remote Debian server using Selenium, I encountered an issue. The server has Firefox 46.0.1 installed and I am using version 2.53.1 of Selenium. Every time I try to run a specific test, the following erro ...

Unable to access code search functionality during the process of scraping from GitHub

Trying to create a simulation of the online GitHub search using Selenium web scraping. Struggling to make the program search within the Code section instead of repositories. Here is the code snippet: FirefoxProfile p = new FirefoxProfile(); p.setPref ...

Tips on executing npm commands on Azure app service following a successful deployment via VSTS?

While I've successfully deployed from VSTS to Azure, I'm facing an issue with running npm after the deploy is complete. The current process involves running npm install for branch files, zipping them, copying to Azure, and deploying. However, I ...

A guide on extracting text enclosed in and using Selenium

When attempting to extract text from an element and display it in the console, I encountered a challenge as the text was surrounded by \n and \t as noted in the JSON file retrieved during a GET request. The HTML structure appears as follows: < ...