Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PY]: Fixes an issue where IE server port is set '0' by default #8294

Merged
merged 2 commits into from
May 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion py/selenium/webdriver/ie/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
from .service import Service
from .options import Options
from selenium.webdriver.common import utils

DEFAULT_TIMEOUT = 30
DEFAULT_PORT = 0
Expand Down Expand Up @@ -62,7 +63,6 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
if port != DEFAULT_PORT:
warnings.warn('port has been deprecated, please pass in a Service object',
DeprecationWarning, stacklevel=2)
self.port = port
if timeout != DEFAULT_TIMEOUT:
warnings.warn('timeout has been deprecated, please pass in a Service object',
DeprecationWarning, stacklevel=2)
Expand All @@ -76,6 +76,9 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
if service_log_path != DEFAULT_SERVICE_LOG_PATH:
warnings.warn('service_log_path has been deprecated, please pass in a Service object',
DeprecationWarning, stacklevel=2)
self.port = port
if self.port == 0:
self.port = utils.free_port()

# If both capabilities and desired capabilities are set, ignore desired capabilities.
if capabilities is None and desired_capabilities:
Expand Down