Skip to content

Commit 8f6cc22

Browse files
authored
[rust] Display warning message due to driver in PATH only if major is different (#12460)
1 parent afe8f71 commit 8f6cc22

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

rust/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,14 @@ pub trait SeleniumManager {
487487
// If driver is in path, always use it
488488
if let (Some(version), Some(path)) = (&driver_in_path_version, &driver_in_path) {
489489
// If proper driver version is not the same as the driver in path, display warning
490-
if !self.get_driver_version().is_empty() && !version.eq(self.get_driver_version()) {
490+
let major_version = self.get_major_version(version)?;
491+
if !self.get_driver_version().is_empty()
492+
&& !major_version.eq(&self.get_major_browser_version())
493+
{
491494
self.get_logger().warn(format!(
492-
"The {} version ({}) detected in PATH at {} might not be compatible with the detected {} version ({}); currently, {} {} is recommended for {} {}.*, so it is advised to delete the driver in PATH and retry",
495+
"The {} version ({}) detected in PATH at {} might not be compatible with \
496+
the detected {} version ({}); currently, {} {} is recommended for {} {}.*, \
497+
so it is advised to delete the driver in PATH and retry",
493498
self.get_driver_name(),
494499
version,
495500
path,

0 commit comments

Comments
 (0)