diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/README-feat b/README-feat new file mode 100644 index 0000000..b60da62 --- /dev/null +++ b/README-feat @@ -0,0 +1,6 @@ +This is a mirror of the python module for selenium. + +This mirror was cloned with: + +git svn clone http://selenium.googlecode.com/svn/trunk/py python-selenium + diff --git a/selenium/webdriver/chrome/service.py b/selenium/webdriver/chrome/service.py index 2d5c25b..173bdae 100644 --- a/selenium/webdriver/chrome/service.py +++ b/selenium/webdriver/chrome/service.py @@ -80,19 +80,22 @@ def stop(self): #Tell the Server to die! import urllib2 - urllib2.urlopen("http://127.0.0.1:%d/shutdown" % self.port) - count = 0 - while not utils.is_connectable(self.port): - if count == 30: - break - count += 1 - time.sleep(1) - - #Tell the Server to properly die in case try: + urllib2.urlopen("http://127.0.0.1:%d/shutdown" % self.port) + + # make sure that shutdown worked by testing the port has gone away + count = 0 + while utils.is_connectable(self.port): + if count == 30: + break + count += 1 + time.sleep(1) + finally: + #Tell the Server to properly die in case if self.process: - os.kill(self.process.pid, signal.SIGTERM) - os.wait() - except AttributeError: - # kill may not be available under windows environment - pass + try: + os.kill(self.process.pid, signal.SIGTERM) + os.wait() + except AttributeError: + # kill may not be available under windows environment + pass diff --git a/selenium/webdriver/chrome/webdriver.py b/selenium/webdriver/chrome/webdriver.py index 20e9f41..75dd604 100644 --- a/selenium/webdriver/chrome/webdriver.py +++ b/selenium/webdriver/chrome/webdriver.py @@ -64,9 +64,15 @@ def __init__(self, executable_path="chromedriver", port=0, RemoteWebDriver.__init__(self, command_executor=self.service.service_url, desired_capabilities=desired_capabilities) - except: - self.quit() - raise WebDriverException("The Driver was not able to start.") + except Exception, e: + try: + self.quit() + raise WebDriverException( + "The Driver was not able to start or communicate (%r)." % e) + except: + raise WebDriverException( + "The Driver was not able to start, communicate, or quit " \ + "(%r)." % e) def quit(self): """