@@ -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 (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 ,
0 commit comments