diff --git a/py/selenium/webdriver/ie/webdriver.py b/py/selenium/webdriver/ie/webdriver.py index c15fc0cc80b4f..b534f2db38b59 100644 --- a/py/selenium/webdriver/ie/webdriver.py +++ b/py/selenium/webdriver/ie/webdriver.py @@ -89,14 +89,15 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None, else: # desired_capabilities stays as passed in capabilities.update(options.to_capabilities()) - if service is None: - service = Service() - self.iedriver = Service( - executable_path, - port=self.port, - host=self.host, - log_level=log_level, - log_file=service_log_path) + if service is not None: + self.iedriver = service + else: + self.iedriver = Service( + executable_path, + port=self.port, + host=self.host, + log_level=log_level, + log_file=service_log_path) self.iedriver.start()