File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
java/client/src/org/openqa/selenium/safari Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -96,18 +96,26 @@ public void setFileDetector(FileDetector detector) {
96
96
97
97
@ Override
98
98
protected void startClient () {
99
- SafariDriverCommandExecutor executor = (SafariDriverCommandExecutor ) this .getCommandExecutor ();
100
- try {
101
- executor .start ();
102
- } catch (IOException e ) {
103
- throw new WebDriverException (e );
99
+ CommandExecutor commandExecutor = this .getCommandExecutor ();
100
+ if (commandExecutor instanceof SafariDriverCommandExecutor ) {
101
+ try {
102
+ ((SafariDriverCommandExecutor )commandExecutor ).start ();
103
+ } catch (IOException e ) {
104
+ throw new WebDriverException (e );
105
+ }
106
+ } else {
107
+ super .startClient ();
104
108
}
105
109
}
106
110
107
111
@ Override
108
112
protected void stopClient () {
109
- SafariDriverCommandExecutor executor = (SafariDriverCommandExecutor ) this .getCommandExecutor ();
110
- executor .stop ();
113
+ CommandExecutor commandExecutor = this .getCommandExecutor ();
114
+ if (commandExecutor instanceof SafariDriverCommandExecutor ) {
115
+ ((SafariDriverCommandExecutor )commandExecutor ).stop ();
116
+ } else {
117
+ super .stopClient ();
118
+ }
111
119
}
112
120
113
121
@ Override
You can’t perform that action at this time.
0 commit comments