Rayrun
← Back to Discord Forum

Error while creating session with the driver service. Stopping driver service: Timed out

I was trying to run Simple Playwright tests using Selenium Grid.

  1. Maven Dependency for Playwright 1.35.0

  2. Selenium Server Jar version 4.10.0

  3. Chrome Driver version 114

  4. Below is the test script

    Playwright playwright = Playwright.create();
     Browser browser = playwright.chromium().launch(new BrowserType.LaunchOptions().setHeadless(false).setSlowMo(50));
     Page page = browser.newPage();
     page.navigate("https://www.google.com");
     page.pause();
  5. I had setup Selenium Grid on my mac machine and running the above script by setting environment variable : SELENIUM_REMOTE_URL and value as the http://ipaddressoftheseleniumgrid:4444/wd/hub

  6. Started Grid using "java -jar selenium-server-4.10.0.jar standalone"

Getting following error and the browser itself is not opening and the url is also not running.

04:31:41.905 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 04:31:41.923 INFO [DriverService$Builder.getLogOutput] - Driver logs no longer sent to console by default; https://www.selenium.dev/documentation/webdriver/drivers/service/#setting-log-output 04:32:01.953 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: Timed out waiting for driver process to start.

I also tried using selenium server 4.7.2,4.8.0, 4.8.1 and facing same issue. Please suggest the appropriate chromedriver version, maven dependency, chrome version(present using 114), selenium server to successfully launch this.

This thread is trying to answer question "What is the appropriate chromedriver version, maven dependency, chrome version, and selenium server to successfully run Simple Playwright tests using Selenium Grid without encountering the 'Timed out waiting for driver process to start' error?"

1 reply

@mxschmitt any pointers

Answer

Setting Up Playwright Tests with Selenium Grid

To run Playwright tests using Selenium Grid, you need to match your Chromedriver version with your Chrome browser version. For instance, if you're using Chrome version 94, your Chromedriver should also be version 94.

Maven Dependencies

Include the necessary dependencies in your pom.xml file. Here's an example:

<dependencies>
  <dependency>
    <groupId>com.microsoft.playwright</groupId>
    <artifactId>playwright</artifactId>
    <version>1.15.0</version>
  </dependency>
  <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.1.0</version>
  </dependency>
</dependencies>

Remember to update the versions as per your requirements.

Chrome Browser Version

Use a stable Chrome release that's compatible with both Playwright and Selenium Grid Hub running Selenium 4. Check their respective documentation or release notes for compatibility.

Selenium Server Version

Ensure you have a compatible version of Selenium server jar file downloaded and configured in your environment. To start a selenium node using Java, use this command:

java -jar selenium-server-<version>.jar node

Replace <version> with the appropriate version number based on your setup.

In conclusion, to run Playwright tests using Selenium Grid, match your Chromedriver version with your Chrome browser version, include the necessary Maven dependencies, use a compatible Chrome browser version, and have a compatible Selenium server configured.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.