Skip to content

Commit b78c8cc

Browse files
blueyedAutomatedTester
authored andcommitted
py: phantomjs: add port information to WebDriverException
In case it cannot connect to GhostDriver, it will now also provide information about the port being used. Signed-off-by: AutomatedTester <dburns@mozilla.com>
1 parent 1bc9c24 commit b78c8cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

py/selenium/webdriver/phantomjs/service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def start(self):
6565
6666
:Exceptions:
6767
- WebDriverException : Raised either when it can't start the service
68-
or when it can't connect to the service
68+
or when it can't connect to the service.
6969
"""
7070
try:
7171
self.process = subprocess.Popen(self.service_args, stdin=subprocess.PIPE,
@@ -79,7 +79,8 @@ def start(self):
7979
count += 1
8080
time.sleep(1)
8181
if count == 30:
82-
raise WebDriverException("Can not connect to GhostDriver")
82+
raise WebDriverException(
83+
"Can not connect to GhostDriver on port {}".format(self.port))
8384

8485
@property
8586
def service_url(self):

0 commit comments

Comments
 (0)