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() {
347
347
}
348
348
349
349
private Optional <BiDi > createBiDi (Optional <URI > biDiUri ) {
350
- if (! biDiUri .isPresent ()) {
350
+ if (biDiUri .isEmpty ()) {
351
351
return Optional .empty ();
352
352
}
353
353
354
354
URI wsUri =
355
355
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." ));
357
360
358
361
HttpClient .Factory clientFactory = HttpClient .Factory .createDefault ();
359
362
ClientConfig wsConfig = ClientConfig .defaultConfig ().baseUri (wsUri );
Original file line number Diff line number Diff line change @@ -354,14 +354,16 @@ public DevTools getDevTools() {
354
354
}
355
355
356
356
private Optional <BiDi > createBiDi (Optional <URI > biDiUri ) {
357
- if (! biDiUri .isPresent ()) {
357
+ if (biDiUri .isEmpty ()) {
358
358
return Optional .empty ();
359
359
}
360
360
361
361
URI wsUri =
362
362
biDiUri .orElseThrow (
363
363
() ->
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." ));
365
367
366
368
HttpClient .Factory clientFactory = HttpClient .Factory .createDefault ();
367
369
ClientConfig wsConfig = ClientConfig .defaultConfig ().baseUri (wsUri );
@@ -380,8 +382,10 @@ public Optional<BiDi> maybeGetBiDi() {
380
382
381
383
@ Override
382
384
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." );
385
389
}
386
390
387
391
return maybeGetBiDi ()
You can’t perform that action at this time.
0 commit comments