Skip to content

Commit

Permalink
DanielWagnerHall: Allow multiple service args to be passed to the chr…
Browse files Browse the repository at this point in the history
…omedriver service

r18237
  • Loading branch information
illicitonion committed Dec 2, 2012
1 parent d1bd660 commit 1cad348
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions py/selenium/webdriver/chrome/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ def __init__(self, executable_path, port=0, service_args=None):
:Args:
- executable_path : Path to the ChromeDriver
- port : Port the service is running on """
- port : Port the service is running on
- service_args : List of args to pass to the chromedriver service"""

self.port = port
self.path = executable_path
self.service_args= service_args
self.service_args = service_args
if self.port == 0:
self.port = utils.free_port()

Expand All @@ -49,8 +50,10 @@ def start(self):
or when it can't connect to the service
"""
try:
self.process = subprocess.Popen([self.path, "--port=%d%s" % (self.port,
' '.join(self.service_args) if self.service_args else '')], stdout=PIPE, stderr=PIPE)
self.process = subprocess.Popen([
self.path,
"--port=%d" % self.port] +
self.service_args or [], stdout=PIPE, stderr=PIPE)
except:
raise WebDriverException(
"ChromeDriver executable needs to be available in the path. \
Expand Down

0 comments on commit 1cad348

Please sign in to comment.