Skip to content

Commit

Permalink
On Behalf of Jason Morrison (jasonm): when using desired capabilities…
Browse files Browse the repository at this point in the history
… and chrome options together, attempt to merge rather than squash.

Fixes Issue #7389
  • Loading branch information
lukeis committed May 27, 2014
1 parent 0dce277 commit 6a7bb83
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions py/selenium/webdriver/chrome/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ def __init__(self, executable_path="chromedriver", port=0,
- chrome_options: this takes an instance of ChromeOptions
"""
if chrome_options is None:
options = Options()
if desired_capabilities is None:
desired_capabilities = Options().to_capabilities()
else:
# desired_capabilities stays as passed
pass
else:
options = chrome_options

if desired_capabilities is not None:
desired_capabilities.update(options.to_capabilities())
else:
desired_capabilities = options.to_capabilities()
if desired_capabilities is None:
desired_capabilities = options.to_capabilities()
else:
desired_capabilities.update(options.to_capabilities())

self.service = Service(executable_path, port=port,
service_args=service_args, log_path=service_log_path)
Expand Down

0 comments on commit 6a7bb83

Please sign in to comment.