@@ -573,22 +573,25 @@ private Map<WebDriverInfo, Collection<SessionFactory>> discoverDrivers(
573573 }
574574
575575 // We don't expect duplicates, but they're fine
576- List <WebDriverInfo > infos =
577- StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
578- .filter (WebDriverInfo ::isPresent )
579- .sorted (Comparator .comparing (info -> info .getDisplayName ().toLowerCase ()))
580- .collect (Collectors .toList ());
581-
576+ List <WebDriverInfo > infos = new ArrayList <>();
582577 if (config .getBool (NODE_SECTION , "selenium-manager" ).orElse (DEFAULT_USE_SELENIUM_MANAGER )) {
583- List <String > present =
584- infos .stream ().map (WebDriverInfo ::getDisplayName ).collect (Collectors .toList ());
585578 List <WebDriverInfo > driversSM =
586579 StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
587- .filter (info -> !present .contains (info .getDisplayName ()))
588580 .filter (WebDriverInfo ::isAvailable )
589581 .sorted (Comparator .comparing (info -> info .getDisplayName ().toLowerCase ()))
590582 .collect (Collectors .toList ());
591583 infos .addAll (driversSM );
584+ } else {
585+ LOG .log (Level .INFO , "Looking for existing drivers on the PATH." );
586+ LOG .log (
587+ Level .INFO ,
588+ "Add '--selenium-manager true' to the startup command to setup drivers automatically." );
589+ List <WebDriverInfo > localDrivers =
590+ StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
591+ .filter (WebDriverInfo ::isPresent )
592+ .sorted (Comparator .comparing (info -> info .getDisplayName ().toLowerCase ()))
593+ .collect (Collectors .toList ());
594+ infos .addAll (localDrivers );
592595 }
593596
594597 // Same
0 commit comments