public static String getSeleniumVersionFromManifest(Manifest manifest) {
        String seleniumVersion = null;
        Attributes buildInfo = manifest.getAttributes("Build-Info");
        if (buildInfo != null) {
            seleniumVersion = buildInfo.getValue("Selenium-Version");
        }

        // Compatibility Selenium > 3.X
        if (seleniumVersion == null) {
            Attributes seleniumInfo = manifest.getAttributes("Selenium");
            if (seleniumInfo != null) {
                seleniumVersion = seleniumInfo.getValue("Selenium-Version");
            }
        }
        return seleniumVersion;
    }
Read Manifest to get Selenium Version.
@param manifest manifest
@return Selenium Version detected
modules/selenium/src/main/java/org/testcontainers/containers/SeleniumUtils.java