27
27
from selenium import webdriver
28
28
from selenium .webdriver import FirefoxProfile
29
29
30
+ from selenium .webdriver .chrome .service import Service as ChromeService
31
+ from selenium .webdriver .edge .service import Service as EdgeService
32
+ from selenium .webdriver .firefox .service import Service as FirefoxService
33
+ from selenium .webdriver .ie .service import Service as IeService
34
+
30
35
from SeleniumLibrary .keywords .webdrivertools .sl_file_detector import (
31
36
SelLibLocalFileDetector ,
32
37
)
@@ -144,12 +149,11 @@ def create_chrome(
144
149
)
145
150
return self ._remote (desired_capabilities , remote_url , options = options )
146
151
if not executable_path :
147
- executable_path = self ._get_executable_path (webdriver .Chrome )
152
+ executable_path = self ._get_executable_path (webdriver .chrome .service .Service )
153
+ service = ChromeService (executable_path = executable_path , log_path = service_log_path )
148
154
return webdriver .Chrome (
149
155
options = options ,
150
- service_log_path = service_log_path ,
151
- executable_path = executable_path ,
152
- ** desired_capabilities ,
156
+ service = service ,
153
157
)
154
158
155
159
def create_headless_chrome (
@@ -195,13 +199,13 @@ def create_firefox(
195
199
service_log_path if service_log_path else self ._geckodriver_log
196
200
)
197
201
if not executable_path :
198
- executable_path = self ._get_executable_path (webdriver .Firefox )
202
+ executable_path = self ._get_executable_path (webdriver .firefox .service .Service )
203
+ service = FirefoxService (executable_path = executable_path , log_path = service_log_path )
199
204
return webdriver .Firefox (
200
205
options = options ,
201
- firefox_profile = profile ,
202
- service_log_path = service_log_path ,
203
- executable_path = executable_path ,
204
- ** desired_capabilities ,
206
+ #firefox_profile=profile, # need to move
207
+ service = service ,
208
+ #**desired_capabilities,
205
209
)
206
210
207
211
def _get_ff_profile (self , ff_profile_dir ):
@@ -267,12 +271,12 @@ def create_ie(
267
271
)
268
272
return self ._remote (desired_capabilities , remote_url , options = options )
269
273
if not executable_path :
270
- executable_path = self ._get_executable_path (webdriver .Ie )
274
+ executable_path = self ._get_executable_path (webdriver .ie .service .Service )
275
+ service = IeService (executable_path = executable_path , log_path = service_log_path )
271
276
return webdriver .Ie (
272
277
options = options ,
273
- service_log_path = service_log_path ,
274
- executable_path = executable_path ,
275
- ** desired_capabilities ,
278
+ service = service ,
279
+ #**desired_capabilities,
276
280
)
277
281
278
282
def _has_options (self , web_driver ):
@@ -294,20 +298,12 @@ def create_edge(
294
298
)
295
299
return self ._remote (desired_capabilities , remote_url )
296
300
if not executable_path :
297
- executable_path = self ._get_executable_path (webdriver .Edge )
298
- if self ._has_options (webdriver .Edge ):
299
- # options is supported from Selenium 4.0 onwards
300
- # If can be removed when minimum Selenium version is 4.0 or greater
301
- return webdriver .Edge (
302
- options = options ,
303
- service_log_path = service_log_path ,
304
- executable_path = executable_path ,
305
- ** desired_capabilities ,
306
- )
301
+ executable_path = self ._get_executable_path (webdriver .edge .service .Service )
302
+ service = EdgeService (executable_path = executable_path , log_path = service_log_path )
307
303
return webdriver .Edge (
308
- service_log_path = service_log_path ,
309
- executable_path = executable_path ,
310
- ** desired_capabilities ,
304
+ options = options ,
305
+ service = service ,
306
+ # **desired_capabilities,
311
307
)
312
308
313
309
def create_safari (
0 commit comments