Skip to content

Commit 6c5c572

Browse files
[py] Correct deprecations in IE bindings. Fixes #9818
1 parent 136067e commit 6c5c572

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

py/selenium/webdriver/common/desired_capabilities.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DesiredCapabilities(object):
5555

5656
INTERNETEXPLORER = {
5757
"browserName": "internet explorer",
58-
"platformName": "WINDOWS",
58+
"platformName": "windows",
5959
}
6060

6161
EDGE = {
@@ -72,7 +72,7 @@ class DesiredCapabilities(object):
7272

7373
SAFARI = {
7474
"browserName": "safari",
75-
"platformName": "MAC",
75+
"platformName": "mac",
7676
}
7777

7878
HTMLUNIT = {
@@ -91,13 +91,13 @@ class DesiredCapabilities(object):
9191
IPHONE = {
9292
"browserName": "iPhone",
9393
"version": "",
94-
"platform": "MAC",
94+
"platform": "mac",
9595
}
9696

9797
IPAD = {
9898
"browserName": "iPad",
9999
"version": "",
100-
"platform": "MAC",
100+
"platform": "mac",
101101
}
102102

103103
WEBKITGTK = {

py/selenium/webdriver/ie/webdriver.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
6161
DeprecationWarning, stacklevel=2)
6262
if capabilities:
6363
warnings.warn('capabilities has been deprecated, please pass in an Options object.'
64-
'This field will be ignored if an Options object is also used.',
64+
'This field will be ignored.',
6565
DeprecationWarning, stacklevel=2)
6666
if port != DEFAULT_PORT:
6767
warnings.warn('port has been deprecated, please pass in a Service object',
@@ -79,32 +79,23 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
7979
warnings.warn('service_log_path has been deprecated, please pass in a Service object',
8080
DeprecationWarning, stacklevel=2)
8181
if desired_capabilities:
82-
warnings.warn('desired_capabilities has been deprecated, please pass in an Options object',
82+
warnings.warn('desired_capabilities has been deprecated, please pass in an Options object.'
83+
'This field will be ignored',
8384
DeprecationWarning, stacklevel=2)
8485
if keep_alive != DEFAULT_KEEP_ALIVE:
8586
warnings.warn('keep_alive has been deprecated, please pass in a Service object',
8687
DeprecationWarning, stacklevel=2)
8788
else:
88-
keep_alive = False
89+
keep_alive = True
8990

9091
self.host = host
9192
self.port = port
9293
if self.port == 0:
9394
self.port = utils.free_port()
9495

95-
# If both capabilities and desired capabilities are set, ignore desired capabilities.
96-
if not capabilities and desired_capabilities:
97-
capabilities = desired_capabilities
98-
9996
if not options:
100-
if not capabilities:
101-
capabilities = self.create_options().to_capabilities()
102-
else:
103-
if not capabilities:
104-
capabilities = options.to_capabilities()
105-
else:
106-
# desired_capabilities stays as passed in
107-
capabilities.update(options.to_capabilities())
97+
options = self.create_options()
98+
10899
if service:
109100
self.iedriver = service
110101
else:

0 commit comments

Comments
 (0)