@@ -140,11 +140,9 @@ def create_chrome(
140
140
executable_path = "chromedriver" ,
141
141
):
142
142
if remote_url :
143
- defaul_caps = webdriver .DesiredCapabilities .CHROME .copy ()
144
- desired_capabilities = self ._remote_capabilities_resolver (
145
- desired_capabilities , defaul_caps
146
- )
147
- return self ._remote (desired_capabilities , remote_url , options = options )
143
+ if not options :
144
+ options = webdriver .ChromeOptions ()
145
+ return self ._remote (remote_url , options = options )
148
146
if not executable_path :
149
147
executable_path = self ._get_executable_path (webdriver .chrome .service .Service )
150
148
service = ChromeService (executable_path = executable_path , log_path = service_log_path )
@@ -196,11 +194,7 @@ def create_firefox(
196
194
# as to attach the profile to it. If there a scenario in which we don't want to do this???
197
195
198
196
if remote_url :
199
- default_caps = webdriver .DesiredCapabilities .FIREFOX .copy ()
200
- desired_capabilities = self ._remote_capabilities_resolver (
201
- desired_capabilities , default_caps
202
- )
203
- return self ._remote (desired_capabilities , remote_url , profile , options )
197
+ return self ._remote (remote_url , options )
204
198
service_log_path = (
205
199
service_log_path if service_log_path else self ._geckodriver_log
206
200
)
@@ -209,9 +203,7 @@ def create_firefox(
209
203
service = FirefoxService (executable_path = executable_path , log_path = service_log_path )
210
204
return webdriver .Firefox (
211
205
options = options ,
212
- #firefox_profile=profile, # need to move
213
206
service = service ,
214
- #**desired_capabilities,
215
207
)
216
208
217
209
def _get_ff_profile (self , ff_profile_dir ):
@@ -271,11 +263,9 @@ def create_ie(
271
263
executable_path = "IEDriverServer.exe" ,
272
264
):
273
265
if remote_url :
274
- defaul_caps = webdriver .DesiredCapabilities .INTERNETEXPLORER .copy ()
275
- desired_capabilities = self ._remote_capabilities_resolver (
276
- desired_capabilities , defaul_caps
277
- )
278
- return self ._remote (desired_capabilities , remote_url , options = options )
266
+ if not options :
267
+ options = webdriver .IeOptions ()
268
+ return self ._remote (remote_url , options = options )
279
269
if not executable_path :
280
270
executable_path = self ._get_executable_path (webdriver .ie .service .Service )
281
271
service = IeService (executable_path = executable_path , log_path = service_log_path )
@@ -298,11 +288,9 @@ def create_edge(
298
288
executable_path = "msedgedriver" ,
299
289
):
300
290
if remote_url :
301
- defaul_caps = webdriver .DesiredCapabilities .EDGE .copy ()
302
- desired_capabilities = self ._remote_capabilities_resolver (
303
- desired_capabilities , defaul_caps
304
- )
305
- return self ._remote (desired_capabilities , remote_url , options = options )
291
+ if not options :
292
+ options = webdriver .EdgeOptions ()
293
+ return self ._remote (remote_url , options = options )
306
294
if not executable_path :
307
295
executable_path = self ._get_executable_path (webdriver .edge .service .Service )
308
296
service = EdgeService (executable_path = executable_path , log_path = service_log_path )
@@ -321,25 +309,21 @@ def create_safari(
321
309
executable_path = "/usr/bin/safaridriver" ,
322
310
):
323
311
if remote_url :
324
- defaul_caps = webdriver .DesiredCapabilities .SAFARI .copy ()
325
- desired_capabilities = self ._remote_capabilities_resolver (
326
- desired_capabilities , defaul_caps
327
- )
328
- return self ._remote (desired_capabilities , remote_url , options = options )
312
+ if not options :
313
+ options = webdriver .SafariOptions ()
314
+ return self ._remote (remote_url , options = options )
329
315
if not executable_path :
330
316
executable_path = self ._get_executable_path (webdriver .Safari )
331
317
service = SafariService (executable_path = executable_path , log_path = service_log_path )
332
318
return webdriver .Safari (options = options , service = service )
333
319
334
- def _remote (self , desired_capabilities , remote_url , profile_dir = None , options = None ):
320
+ def _remote (self , remote_url , options ):
335
321
remote_url = str (remote_url )
336
322
file_detector = self ._get_sl_file_detector ()
337
323
return webdriver .Remote (
338
324
command_executor = remote_url ,
339
- # browser_profile=profile_dir,
340
325
options = options ,
341
326
file_detector = file_detector ,
342
- # **desired_capabilities,
343
327
)
344
328
345
329
def _get_sl_file_detector (self ):
0 commit comments