@@ -131,6 +131,16 @@ def _remote_capabilities_resolver(self, set_capabilities, default_capabilities):
131131 caps ["browserName" ] = default_capabilities ["browserName" ]
132132 return {"desired_capabilities" : caps }
133133
134+ def _get_log_method (self , service_cls , service_log_path ):
135+ # -- temporary fix to transition selenium to v4.13 from v4.11 and prior
136+ from inspect import signature
137+ sig = signature (service_cls )
138+ if 'log_output' in str (sig ):
139+ return {'log_output' : service_log_path }
140+ else :
141+ return {'log_path' : service_log_path }
142+ # --
143+
134144 def create_chrome (
135145 self ,
136146 desired_capabilities ,
@@ -145,14 +155,7 @@ def create_chrome(
145155 return self ._remote (remote_url , options = options )
146156 if not executable_path :
147157 executable_path = self ._get_executable_path (webdriver .chrome .service .Service )
148- # -- temporary fix to transition selenium to v4.13 from v4.11 and prior
149- from inspect import signature
150- sig = signature (ChromeService )
151- if 'log_output' in str (sig ):
152- log_method = {'log_output' : service_log_path }
153- else :
154- log_method = {'log_path' : service_log_path }
155- # --
158+ log_method = self ._get_log_method (ChromeService , service_log_path )
156159 service = ChromeService (executable_path = executable_path , ** log_method )
157160 return webdriver .Chrome (
158161 options = options ,
@@ -203,12 +206,10 @@ def create_firefox(
203206
204207 if remote_url :
205208 return self ._remote (remote_url , options )
206- service_log_path = (
207- service_log_path if service_log_path else self ._geckodriver_log
208- )
209209 if not executable_path :
210210 executable_path = self ._get_executable_path (webdriver .firefox .service .Service )
211- service = FirefoxService (executable_path = executable_path , log_path = service_log_path )
211+ log_method = self ._get_log_method (FirefoxService , service_log_path or self ._geckodriver_log )
212+ service = FirefoxService (executable_path = executable_path , ** log_method )
212213 return webdriver .Firefox (
213214 options = options ,
214215 service = service ,
@@ -276,7 +277,8 @@ def create_ie(
276277 return self ._remote (remote_url , options = options )
277278 if not executable_path :
278279 executable_path = self ._get_executable_path (webdriver .ie .service .Service )
279- service = IeService (executable_path = executable_path , log_path = service_log_path )
280+ log_method = self ._get_log_method (IeService , service_log_path )
281+ service = IeService (executable_path = executable_path , ** log_method )
280282 return webdriver .Ie (
281283 options = options ,
282284 service = service ,
@@ -301,7 +303,8 @@ def create_edge(
301303 return self ._remote (remote_url , options = options )
302304 if not executable_path :
303305 executable_path = self ._get_executable_path (webdriver .edge .service .Service )
304- service = EdgeService (executable_path = executable_path , log_path = service_log_path )
306+ log_method = self ._get_log_method (EdgeService , service_log_path )
307+ service = EdgeService (executable_path = executable_path , ** log_method )
305308 return webdriver .Edge (
306309 options = options ,
307310 service = service ,
@@ -322,7 +325,8 @@ def create_safari(
322325 return self ._remote (remote_url , options = options )
323326 if not executable_path :
324327 executable_path = self ._get_executable_path (webdriver .Safari )
325- service = SafariService (executable_path = executable_path , log_path = service_log_path )
328+ log_method = self ._get_log_method (SafariService , service_log_path )
329+ service = SafariService (executable_path = executable_path , ** log_method )
326330 return webdriver .Safari (options = options , service = service )
327331
328332 def _remote (self , remote_url , options ):
0 commit comments