File tree Expand file tree Collapse file tree 2 files changed +28
-11
lines changed
java/src/org/openqa/selenium/safari Expand file tree Collapse file tree 2 files changed +28
-11
lines changed Original file line number Diff line number Diff line change 24
24
import java .util .Optional ;
25
25
import org .openqa .selenium .Capabilities ;
26
26
import org .openqa .selenium .ImmutableCapabilities ;
27
+ import org .openqa .selenium .Platform ;
27
28
import org .openqa .selenium .SessionNotCreatedException ;
28
29
import org .openqa .selenium .WebDriver ;
29
30
import org .openqa .selenium .WebDriverException ;
@@ -65,8 +66,12 @@ public boolean isSupportingBiDi() {
65
66
@ Override
66
67
public boolean isAvailable () {
67
68
try {
68
- DriverFinder .getPath (SafariDriverService .createDefaultService (), getCanonicalCapabilities ());
69
- return true ;
69
+ if (Platform .getCurrent ().is (Platform .MAC )) {
70
+ DriverFinder .getPath (
71
+ SafariDriverService .createDefaultService (), getCanonicalCapabilities ());
72
+ return true ;
73
+ }
74
+ return false ;
70
75
} catch (IllegalStateException | WebDriverException e ) {
71
76
return false ;
72
77
}
@@ -75,9 +80,12 @@ public boolean isAvailable() {
75
80
@ Override
76
81
public boolean isPresent () {
77
82
try {
78
- DriverFinder .getPath (
79
- SafariDriverService .createDefaultService (), getCanonicalCapabilities (), true );
80
- return true ;
83
+ if (Platform .getCurrent ().is (Platform .MAC )) {
84
+ DriverFinder .getPath (
85
+ SafariDriverService .createDefaultService (), getCanonicalCapabilities (), true );
86
+ return true ;
87
+ }
88
+ return false ;
81
89
} catch (IllegalStateException | WebDriverException e ) {
82
90
return false ;
83
91
}
Original file line number Diff line number Diff line change 24
24
import java .util .Optional ;
25
25
import org .openqa .selenium .Capabilities ;
26
26
import org .openqa .selenium .ImmutableCapabilities ;
27
+ import org .openqa .selenium .Platform ;
27
28
import org .openqa .selenium .SessionNotCreatedException ;
28
29
import org .openqa .selenium .WebDriver ;
29
30
import org .openqa .selenium .WebDriverException ;
@@ -66,9 +67,12 @@ public boolean isSupportingBiDi() {
66
67
@ Override
67
68
public boolean isAvailable () {
68
69
try {
69
- DriverFinder .getPath (
70
- SafariTechPreviewDriverService .createDefaultService (), getCanonicalCapabilities ());
71
- return true ;
70
+ if (Platform .getCurrent ().is (Platform .MAC )) {
71
+ DriverFinder .getPath (
72
+ SafariTechPreviewDriverService .createDefaultService (), getCanonicalCapabilities ());
73
+ return true ;
74
+ }
75
+ return false ;
72
76
} catch (IllegalStateException | WebDriverException e ) {
73
77
return false ;
74
78
}
@@ -77,9 +81,14 @@ public boolean isAvailable() {
77
81
@ Override
78
82
public boolean isPresent () {
79
83
try {
80
- DriverFinder .getPath (
81
- SafariTechPreviewDriverService .createDefaultService (), getCanonicalCapabilities (), true );
82
- return true ;
84
+ if (Platform .getCurrent ().is (Platform .MAC )) {
85
+ DriverFinder .getPath (
86
+ SafariTechPreviewDriverService .createDefaultService (),
87
+ getCanonicalCapabilities (),
88
+ true );
89
+ return true ;
90
+ }
91
+ return false ;
83
92
} catch (IllegalStateException | WebDriverException e ) {
84
93
return false ;
85
94
}
You can’t perform that action at this time.
0 commit comments