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

Method get_browser_path_or_latest_from_cache

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

Source from the content-addressed store, hash-verified

1095 }
1096
1097 fn get_browser_path_or_latest_from_cache(&self) -> String {
1098 let mut browser_path = self.get_browser_path().to_string();
1099 if browser_path.is_empty() {
1100 let best_browser_from_cache = &self
1101 .find_best_browser_from_cache()
1102 .unwrap_or_default()
1103 .unwrap_or_default();
1104 if best_browser_from_cache.exists() {
1105 self.get_logger().debug_or_warn(
1106 format!(
1107 "There was an error managing {}; using browser found in the cache",
1108 self.get_browser_name()
1109 ),
1110 self.is_offline(),
1111 );
1112 browser_path = path_to_string(best_browser_from_cache);
1113 }
1114 }
1115 browser_path
1116 }
1117
1118 fn find_best_browser_from_cache(&self) -> Result<Option<PathBuf>, Error> {
1119 let cache_path = self.get_cache_path()?.unwrap_or_default();

Callers 1

mainFunction · 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

path_to_stringFunction · 0.85
is_emptyMethod · 0.80
debug_or_warnMethod · 0.80
is_offlineMethod · 0.80
get_browser_pathMethod · 0.45
existsMethod · 0.45
get_loggerMethod · 0.45

Tested by

no test coverage detected