MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / find_browser_in_path

Method find_browser_in_path

rust/src/lib.rs:678–703  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

676 }
677
678 fn find_browser_in_path(&self) -> Option<PathBuf> {
679 for browser_name in self.get_browser_names_in_path().iter() {
680 self.get_logger()
681 .trace(format!("Checking {} in PATH", browser_name));
682 let browser_path = self.execute_which_in_shell(browser_name);
683 if let Some(path) = browser_path {
684 self.get_logger()
685 .debug(format!("Found {} in PATH: {}", browser_name, &path));
686 if self.is_snap(&path)
687 && let Some(snap_path) = self.get_snap_path()
688 && snap_path.exists()
689 {
690 self.get_logger().debug(format!(
691 "Using {} snap: {}",
692 browser_name,
693 path_to_string(snap_path.as_path())
694 ));
695 return Some(snap_path);
696 }
697 return Some(Path::new(&path).to_path_buf());
698 }
699 }
700 self.get_logger()
701 .debug(format!("{} not found in PATH", self.get_browser_name()));
702 None
703 }
704
705 fn find_driver_in_path(&self) -> (Option<String>, Option<String>) {
706 let driver_version_command = Command::new(

Callers 1

detect_browser_pathMethod · 0.80

Implementers 8

edge.rsrust/src/edge.rs
iexplorer.rsrust/src/iexplorer.rs
safaritp.rsrust/src/safaritp.rs
electron.rsrust/src/electron.rs
chrome.rsrust/src/chrome.rs
firefox.rsrust/src/firefox.rs
grid.rsrust/src/grid.rs
safari.rsrust/src/safari.rs

Calls 8

traceMethod · 0.80
get_loggerMethod · 0.45
debugMethod · 0.45
is_snapMethod · 0.45
get_snap_pathMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected