{"record":{"id":"605f06c2234ddf90","repo":"SeleniumHQ/selenium","slug":"wrong-version-605f06","errorCode":null,"errorMessage":"Wrong version: {}","messagePattern":"Wrong version: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"rust/src/lib.rs","lineNumber":1996,"sourceCode":"        .replacen(\"{}\", arg2, 1)\n        .replacen(\"{}\", arg3, 1)\n}\n\npub fn format_four_args(string: &str, arg1: &str, arg2: &str, arg3: &str, arg4: &str) -> String {\n    string\n        .replacen(\"{}\", arg1, 1)\n        .replacen(\"{}\", arg2, 1)\n        .replacen(\"{}\", arg3, 1)\n        .replacen(\"{}\", arg4, 1)\n}\n\n// ----------------------------------------------------------\n// Private functions\n// ----------------------------------------------------------\n\nfn get_index_version(full_version: &str, index: usize) -> Result<String, Error> {\n    if full_version.is_empty() {\n        return Err(anyhow!(format!(\"Wrong version: {}\", full_version)));\n    }\n    let version_vec: Vec<&str> = full_version.split('.').collect();\n    Ok(version_vec\n        .get(index)\n        .ok_or(anyhow!(format!(\"Wrong version: {}\", full_version)))?\n        .to_string())\n}\n\n#[cfg(test)]\nmod index_version_tests {\n    use super::*;\n\n    #[test]\n    fn get_index_version_major() {\n        assert_eq!(get_index_version(\"120.0.6099.109\", 0).unwrap(), \"120\");\n    }\n\n    #[test]","sourceCodeStart":1978,"sourceCodeEnd":2014,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rust/src/lib.rs#L1978-L2014","documentation":"Thrown by the private helper get_index_version() when the incoming version string is empty. This helper splits on '.' and returns the segment at the given index, so an empty input is rejected before splitting. The placeholder is the empty string.","triggerScenarios":"get_index_version(full_version, index) is called with full_version.is_empty() == true (lib.rs:1994-1996), e.g. get_major_version/major-browser-version logic receiving an empty string.","commonSituations":"An upstream browser/driver version resolved as empty and then fed into major-version extraction; a capability or config supplied an empty browserVersion.","solutions":["Trace the empty version in the Selenium Manager debug log to see which field was blank.","Supply a concrete browser/driver version instead of leaving it empty.","Ensure the browser is installed/detectable so a non-empty version is resolved."],"exampleFix":"# before\nselenium-manager --browser chrome --browser-version \"\"   # empty\n# after\nselenium-manager --browser chrome --browser-version 131","handlingStrategy":"validation","validationCode":"fn require_nonempty_version(v: &str) -> Result<&str, Error> {\n    if v.is_empty() { Err(anyhow!(\"version must not be empty\")) } else { Ok(v) }\n}\nlet major = get_index_version(require_nonempty_version(&version)?, 0)?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply a concrete browser/driver version instead of an empty string.","Validate version fields at the config boundary.","Log resolved versions to catch empty-upstream values early."],"tags":["version-parsing","validation","selenium-manager"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}