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:1075–1094  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1073 }
1074
1075 fn get_browser_path_or_latest_from_cache(&self) -> String {
1076 let mut browser_path = self.get_browser_path().to_string();
1077 if browser_path.is_empty() {
1078 let best_browser_from_cache = &self
1079 .find_best_browser_from_cache()
1080 .unwrap_or_default()
1081 .unwrap_or_default();
1082 if best_browser_from_cache.exists() {
1083 self.get_logger().debug_or_warn(
1084 format!(
1085 "There was an error managing {}; using browser found in the cache",
1086 self.get_browser_name()
1087 ),
1088 self.is_offline(),
1089 );
1090 browser_path = path_to_string(best_browser_from_cache);
1091 }
1092 }
1093 browser_path
1094 }
1095
1096 fn find_best_browser_from_cache(&self) -> Result<Option<PathBuf>, Error> {
1097 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