nanasess / setup-chromedriver

ChromeDriver for use in GitHub Actions
MIT License
116 stars 37 forks source link

Could not open connection: session not created: This version of ChromeDriver only supports Chrome version 121 #333

Open kedarkhaire opened 2 months ago

kedarkhaire commented 2 months ago

nanasess/setup-chromedriver@v2 is used for Drupal PHPUnit tests

Currently facing issue with the following error message The original message while starting Mink: Could not open connection: session not created: This version of ChromeDriver only supports Chrome version 121 Current browser version is 127.0.6533.89 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome (Driver info: chromedriver=121.0.6167.85 The test wasn't able to connect to your webdriver instance.

Can we please look into this issue Drupal 10.3 used PHP 8.2 & 8.3

nanasess commented 2 months ago

@kedarkhaire Can you show me the GitHub Actions log?

kedarkhaire commented 2 months ago

WebDriver\Exception\ElementNotInteractable: element not interactable (Session info: chrome=127..6533.72) (Driver info: chromedriver=127..6533.72

Link for action log

Thanks!

nanasess commented 2 months ago

@kedarkhaire It does not appear to be a setup-chromedriver issue. Please confirm that the following simple test is successful. https://github.com/nanasess/setup-chromedriver/blob/master/__tests__/chromedriver.ts

kedarkhaire commented 2 months ago

Hi @nanasess The above script to check is in typescript, can you provide the same executable in php. Thanks!

nanasess commented 2 months ago

@kedarkhaire I asked GitHub Copilot to do the conversion for me. Would this be of any use to you?

<?php
require 'vendor/autoload.php';

use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\WebDriverExpectedCondition;
use Facebook\WebDriver\WebDriverKeys;

$timeout = 30000;
$host = 'http://localhost:4444/wd/hub'; // URL of the Selenium server
$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());

try {
    $driver->get('https://google.com');
    $driver->wait($timeout / 1000)->until(
        WebDriverExpectedCondition::titleContains('Google')
    );
    echo $driver->getTitle() . "\n";

    $searchBox = $driver->findElement(WebDriverBy::name('q'));
    $searchBox->sendKeys('ChromeDriver' . WebDriverKeys::RETURN);
    $driver->wait($timeout / 1000)->until(
        WebDriverExpectedCondition::titleContains('ChromeDriver')
    );
    echo $driver->getTitle() . "\n";
} finally {
    $driver->quit();
}
kedarkhaire commented 2 months ago

I will need to modify it, but thanks for the help, I will check.

nanasess commented 2 months ago

@kedarkhaire Is the error in this assignment the same as the error below? https://github.com/nanasess/setup-chromedriver/actions/runs/10353566059/job/28656781392

kedarkhaire commented 2 months ago

Not the same, just SessionNotCreatedError: session not created: is same, in our case the chromedriver version is not supported & in the link mentioned above the some file is missing.