@@ -573,22 +573,25 @@ private Map<WebDriverInfo, Collection<SessionFactory>> discoverDrivers(
573
573
}
574
574
575
575
// 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 <>();
582
577
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 ());
585
578
List <WebDriverInfo > driversSM =
586
579
StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
587
- .filter (info -> !present .contains (info .getDisplayName ()))
588
580
.filter (WebDriverInfo ::isAvailable )
589
581
.sorted (Comparator .comparing (info -> info .getDisplayName ().toLowerCase ()))
590
582
.collect (Collectors .toList ());
591
583
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 );
592
595
}
593
596
594
597
// Same
0 commit comments