36
36
import java .util .Comparator ;
37
37
import java .util .HashMap ;
38
38
import java .util .List ;
39
+ import java .util .Locale ;
39
40
import java .util .Map ;
40
41
import java .util .Optional ;
41
42
import java .util .ServiceLoader ;
@@ -582,16 +583,21 @@ private void addSpecificDrivers(
582
583
583
584
Optional <Map .Entry <WebDriverInfo , Collection <SessionFactory >>> first =
584
585
allDrivers .entrySet ().stream ()
585
- .filter (entry -> drivers .contains (entry .getKey ().getDisplayName ().toLowerCase ()))
586
+ .filter (
587
+ entry ->
588
+ drivers .contains (entry .getKey ().getDisplayName ().toLowerCase (Locale .ENGLISH )))
586
589
.findFirst ();
587
590
588
591
if (first .isEmpty ()) {
589
592
throw new ConfigException ("No drivers were found for %s" , drivers .toString ());
590
593
}
591
594
592
595
allDrivers .entrySet ().stream ()
593
- .filter (entry -> drivers .contains (entry .getKey ().getDisplayName ().toLowerCase ()))
594
- .sorted (Comparator .comparing (entry -> entry .getKey ().getDisplayName ().toLowerCase ()))
596
+ .filter (
597
+ entry -> drivers .contains (entry .getKey ().getDisplayName ().toLowerCase (Locale .ENGLISH )))
598
+ .sorted (
599
+ Comparator .comparing (
600
+ entry -> entry .getKey ().getDisplayName ().toLowerCase (Locale .ENGLISH )))
595
601
.peek (this ::report )
596
602
.forEach (
597
603
entry -> {
@@ -614,7 +620,8 @@ private Map<WebDriverInfo, Collection<SessionFactory>> discoverDrivers(
614
620
List <WebDriverInfo > driversSM =
615
621
StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
616
622
.filter (WebDriverInfo ::isAvailable )
617
- .sorted (Comparator .comparing (info -> info .getDisplayName ().toLowerCase ()))
623
+ .sorted (
624
+ Comparator .comparing (info -> info .getDisplayName ().toLowerCase (Locale .ENGLISH )))
618
625
.collect (Collectors .toList ());
619
626
infos .addAll (driversSM );
620
627
} else {
@@ -625,7 +632,8 @@ private Map<WebDriverInfo, Collection<SessionFactory>> discoverDrivers(
625
632
List <WebDriverInfo > localDrivers =
626
633
StreamSupport .stream (ServiceLoader .load (WebDriverInfo .class ).spliterator (), false )
627
634
.filter (WebDriverInfo ::isPresent )
628
- .sorted (Comparator .comparing (info -> info .getDisplayName ().toLowerCase ()))
635
+ .sorted (
636
+ Comparator .comparing (info -> info .getDisplayName ().toLowerCase (Locale .ENGLISH )))
629
637
.collect (Collectors .toList ());
630
638
infos .addAll (localDrivers );
631
639
}
@@ -708,7 +716,7 @@ public Optional<WebDriver> createDriver(Capabilities capabilities)
708
716
private int getDriverMaxSessions (WebDriverInfo info , int desiredMaxSessions ) {
709
717
// Safari and Safari Technology Preview
710
718
if (info .getMaximumSimultaneousSessions () == 1
711
- && SINGLE_SESSION_DRIVERS .contains (info .getDisplayName ().toLowerCase ())) {
719
+ && SINGLE_SESSION_DRIVERS .contains (info .getDisplayName ().toLowerCase (Locale . ENGLISH ))) {
712
720
return info .getMaximumSimultaneousSessions ();
713
721
}
714
722
boolean overrideMaxSessions =
0 commit comments