File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
java/src/org/openqa/selenium Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -347,13 +347,16 @@ public Optional<DevTools> maybeGetDevTools() {
347347 }
348348
349349 private Optional <BiDi > createBiDi (Optional <URI > biDiUri ) {
350- if (! biDiUri .isPresent ()) {
350+ if (biDiUri .isEmpty ()) {
351351 return Optional .empty ();
352352 }
353353
354354 URI wsUri =
355355 biDiUri .orElseThrow (
356- () -> new BiDiException ("This version of Chromium driver does not support BiDi" ));
356+ () ->
357+ new BiDiException (
358+ "Check if this browser version supports BiDi and if the 'webSocketUrl: true'"
359+ + " capability is set." ));
357360
358361 HttpClient .Factory clientFactory = HttpClient .Factory .createDefault ();
359362 ClientConfig wsConfig = ClientConfig .defaultConfig ().baseUri (wsUri );
Original file line number Diff line number Diff line change @@ -354,14 +354,16 @@ public DevTools getDevTools() {
354354 }
355355
356356 private Optional <BiDi > createBiDi (Optional <URI > biDiUri ) {
357- if (! biDiUri .isPresent ()) {
357+ if (biDiUri .isEmpty ()) {
358358 return Optional .empty ();
359359 }
360360
361361 URI wsUri =
362362 biDiUri .orElseThrow (
363363 () ->
364- new BiDiException ("This version of Firefox or geckodriver does not support BiDi" ));
364+ new BiDiException (
365+ "Check if this browser version supports BiDi and if the 'webSocketUrl: true'"
366+ + " capability is set." ));
365367
366368 HttpClient .Factory clientFactory = HttpClient .Factory .createDefault ();
367369 ClientConfig wsConfig = ClientConfig .defaultConfig ().baseUri (wsUri );
@@ -380,8 +382,10 @@ public Optional<BiDi> maybeGetBiDi() {
380382
381383 @ Override
382384 public BiDi getBiDi () {
383- if (!biDiUri .isPresent ()) {
384- throw new BiDiException ("This version of Firefox or geckodriver does not support Bidi" );
385+ if (biDiUri .isEmpty ()) {
386+ throw new BiDiException (
387+ "Check if this browser version supports BiDi and if the 'webSocketUrl: true' capability"
388+ + " is set." );
385389 }
386390
387391 return maybeGetBiDi ()
You can’t perform that action at this time.
0 commit comments