Skip to content

Commit

Permalink
[rust] Fix webview2 support when browser path is set (SeleniumHQ#13204)
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia authored Nov 27, 2023
1 parent dde3eed commit c806757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ pub trait SeleniumManager {
} else {
self.set_browser_version(discovered_version);
}
if self.is_webview2() {
if self.is_webview2() && PathBuf::from(self.get_browser_path()).is_dir() {
let browser_path = format!(
r#"{}\{}\msedge{}"#,
self.get_browser_path(),
Expand Down Expand Up @@ -1029,7 +1029,7 @@ pub trait SeleniumManager {
let mut commands = Vec::new();

if WINDOWS.is(self.get_os()) {
if !escaped_browser_path.is_empty() && !self.is_webview2() {
if !escaped_browser_path.is_empty() {
let wmic_command =
Command::new_single(format_one_arg(WMIC_COMMAND, &escaped_browser_path));
commands.push(wmic_command);
Expand Down

0 comments on commit c806757

Please sign in to comment.