{"record":{"id":"b48ff2feb808841f","repo":"testcontainers/testcontainers-java","slug":"for-browser-microsoftedge-selenium-version-must-be-4-or","errorCode":null,"errorMessage":"For browser 'MicrosoftEdge' selenium version must be 4 or higher;docker images are available from there upwards;provided version: '${seleniumVersion}'","messagePattern":"For browser 'MicrosoftEdge' selenium version must be 4 or higher;docker images are available from there upwards;provided version: '(.+?)'","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java","lineNumber":262,"sourceCode":"    @Deprecated\n    public static String getDockerImageForCapabilities(Capabilities capabilities, String seleniumVersion) {\n        return getStandardImageForCapabilities(capabilities, seleniumVersion).asCanonicalNameString();\n    }\n\n    private static DockerImageName getStandardImageForCapabilities(Capabilities capabilities, String seleniumVersion) {\n        String browserName = capabilities == null ? BrowserType.CHROME : capabilities.getBrowserName();\n        boolean supportsVncWithoutDebugImage = new ComparableVersion(seleniumVersion).isGreaterThanOrEqualTo(\"4\");\n\n        switch (browserName) {\n            case BrowserType.CHROME:\n                return (supportsVncWithoutDebugImage ? CHROME_IMAGE : CHROME_DEBUG_IMAGE).withTag(seleniumVersion);\n            case BrowserType.FIREFOX:\n                return (supportsVncWithoutDebugImage ? FIREFOX_IMAGE : FIREFOX_DEBUG_IMAGE).withTag(seleniumVersion);\n            case BrowserType.EDGE:\n                if (supportsVncWithoutDebugImage) {\n                    return EDGE_IMAGE.withTag(seleniumVersion);\n                }\n                throw new UnsupportedOperationException(\n                    \"For browser 'MicrosoftEdge' selenium version must be 4 or higher;\" +\n                    \"docker images are available from there upwards;\" +\n                    \"provided version: '\" +\n                    seleniumVersion +\n                    \"'\"\n                );\n            default:\n                throw new UnsupportedOperationException(\n                    \"Browser name must be 'chrome', 'firefox' or 'MicrosoftEdge';\" +\n                    \"provided '\" +\n                    browserName +\n                    \"' is not supported\"\n                );\n        }\n    }\n\n    public URL getSeleniumAddress() {\n        try {","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java#L244-L280","documentation":"BrowserWebDriverContainer.getStandardImageForCapabilities maps a browser type to a docker image. Edge standalone (non-debug) selenium docker images only exist from Selenium 4 onwards; if the configured selenium version is < 4 (so a debug image would be needed but Edge has no debug variant), it throws UnsupportedOperationException with this message.","triggerScenarios":"Using BrowserWebDriverContainer (deprecated module) with an Edge/Firefox-capabilities lookup while the selenium image tag is 3.x, e.g. seleniumVersion=\"3.141.59\" and browser=MicrosoftEdge via standardImageForCapabilities or getDockerImageForCapabilities.","commonSituations":"Legacy test suites pinned to Selenium 3 images, migrating old code that used Edge on selenium/standalone-debug 3.x, env-var or property supplying an old selenium version.","solutions":["Upgrade the selenium version/tag to 4.x or higher, e.g. selenium/standalone-edge:4.9.0.","Switch to the newer org.testcontainers.selenium.BrowserWebDriverContainer or SeleniumContainer APIs supporting modern Edge images.","If Selenium 3 is mandatory, switch the browser to Chrome or Firefox which have debug images.","Make sure the seleniumVersion field/property is not defaulted from an old constant."],"exampleFix":"// before\ncontainer.withCapabilities(new EdgeOptions())\n    .withRecordingFileFactory(...) // seleniumVersion = 3.141.59\n// after\nSystem.setProperty(\"selenium.version\", \"4.9.0\"); // or use selenium/standalone-edge:4.x tag\ncontainer.withCapabilities(new EdgeOptions())...","handlingStrategy":"validation","validationCode":"static void requireSelenium4ForEdge(String seleniumVersion) {\n  int major = Integer.parseInt(seleniumVersion.split(\"\\\\.\")[0]);\n  if (\"MicrosoftEdge\".equals(browser) && major < 4)\n    throw new IllegalArgumentException(\"Edge requires selenium >= 4, got \" + seleniumVersion);\n}","typeGuard":null,"tryCatchPattern":"try {\n  String image = BrowserWebDriverContainer.standardImageForCapabilities(\"MicrosoftEdge\", version);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"MicrosoftEdge\")) {\n    version = \"4.9.0\"; // retry with Selenium 4 tag\n    image = BrowserWebDriverContainer.standardImageForCapabilities(\"MicrosoftEdge\", version);\n  } else throw e;\n}","preventionTips":["Pin selenium image tags to 4.x for Edge tests","Don't source seleniumVersion from legacy Selenium 3 constants","Prefer the maintained selenium module containers"],"tags":["selenium","edge","version-check","unsupported-browser"],"backgroundTag":"invalid-config-value","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}