@@ -382,7 +382,16 @@ pub trait SeleniumManager {
382382 // Check browser in PATH
383383 let browser_in_path = self . find_browser_in_path ( ) ;
384384 if let Some ( path) = & browser_in_path {
385- self . set_browser_path ( path_to_string ( path) ) ;
385+ if self . is_skip_browser_in_path ( ) {
386+ self . get_logger ( ) . debug ( format ! (
387+ "Skipping {} in path: {}" ,
388+ self . get_browser_name( ) ,
389+ path. display( )
390+ ) ) ;
391+ return None ;
392+ } else {
393+ self . set_browser_path ( path_to_string ( path) ) ;
394+ }
386395 }
387396 browser_in_path
388397 }
@@ -775,8 +784,16 @@ pub trait SeleniumManager {
775784 self . get_major_browser_version( )
776785 ) ) ;
777786 }
778- self . set_driver_version ( version. to_string ( ) ) ;
779- return Ok ( PathBuf :: from ( path) ) ;
787+ if self . is_skip_driver_in_path ( ) {
788+ self . get_logger ( ) . debug ( format ! (
789+ "Skipping {} in path: {}" ,
790+ self . get_driver_name( ) ,
791+ path
792+ ) ) ;
793+ } else {
794+ self . set_driver_version ( version. to_string ( ) ) ;
795+ return Ok ( PathBuf :: from ( path) ) ;
796+ }
780797 }
781798
782799 // If driver was not in the PATH, try to find it in the cache
@@ -1327,6 +1344,26 @@ pub trait SeleniumManager {
13271344 }
13281345 }
13291346
1347+ fn is_skip_driver_in_path ( & self ) -> bool {
1348+ self . get_config ( ) . skip_driver_in_path
1349+ }
1350+
1351+ fn set_skip_driver_in_path ( & mut self , skip_driver_in_path : bool ) {
1352+ if skip_driver_in_path {
1353+ self . get_config_mut ( ) . skip_driver_in_path = true ;
1354+ }
1355+ }
1356+
1357+ fn is_skip_browser_in_path ( & self ) -> bool {
1358+ self . get_config ( ) . skip_browser_in_path
1359+ }
1360+
1361+ fn set_skip_browser_in_path ( & mut self , skip_browser_in_path : bool ) {
1362+ if skip_browser_in_path {
1363+ self . get_config_mut ( ) . skip_browser_in_path = true ;
1364+ }
1365+ }
1366+
13301367 fn get_cache_path ( & self ) -> Result < Option < PathBuf > , Error > {
13311368 let path = Path :: new ( & self . get_config ( ) . cache_path ) ;
13321369 match create_path_if_not_exists ( path) {
0 commit comments