SessionNotCreatedException thrown intermittently by Selenium on Microsoft hosted agent

Tomasz Moczadlowski 0 Reputation points
2023-09-27T14:27:57.29+00:00

I'm facing an intermittent problem with Selenium tests executed from Azure pipelines on Microsoft hosted agents.

My framework based on Serenity BDD uses Chromedriver available in the system PATH variable.

From time to time, at the beginning of a test suite SessionNotCreatedException is thrown when the test code tries to open a url for the first time.

It looks like chromedriver cannot get in touch with the browser or cannot start it. Next test cases are usually successful and tests run as expected.

Here's the sequence of exceptions:


net.thucydides.core.webdriver.DriverConfigurationError:

WebDriver was unable to create a new instance of type class org.openqa.selenium.chrome.ChromeDriver

WebDriver reported the following message: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist

[...]

Could not instantiate class org.openqa.selenium.chrome.ChromeDriver

[...]

WebDriver reported the following message: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: DevToolsActivePort file doesn't exist

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to bind the port.

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ommi Naveen Kumar 195 Reputation points Moderator
    2023-09-28T05:51:23.3233333+00:00

    Hello @Tomasz Moczadlowski

    Welcome to Microsoft Q&A Platform, thanks for posting your query here. Azure DevOps related queries/issues are currently not supported on this Microsoft Q&A platform.

    I would request you to please post your queries in dedicated forums as in below links:

    https://developercommunity.visualstudio.com/spaces/21/index.html

    https://developercommunity.visualstudio.com/t/get-unique-id-from-devops-organization/756710

    https://stackoverflow.com/questions/tagged/azure-devops

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.