SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.55k stars 8.16k forks source link

[Python 3.5] Selenium PhantomJS webdriver fails to stop on self.process #1491

Closed cbdelavenne closed 8 years ago

cbdelavenne commented 8 years ago

Calling self.service.stop() throws an AttributeError 'NoneType' on 'close':


lib\sitenav_helper.py:237: in end_session
    selenium_helper.clean_quit(driver=self._browser)
lib\selenium_helper.py:36: in clean_quit
    driver.quit()  # Terminates selenium
c:\program files\python 3.5\lib\site-packages\selenium\webdriver\phantomjs\webdriver.py:74: in quit
    self.service.stop()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.phantomjs.service.Service object at 0x00000079F748C198>

    def stop(self):
        """
            Stops the service.
            """
        if self.log_file != PIPE:
            try:
                self.log_file.close()
            except Exception:
                pass

        if self.process is None:
            return

        self.send_remote_shutdown_command()

        try:
            if self.process:
>               self.process.stdout.close()
E               AttributeError: 'NoneType' object has no attribute 'close'

c:\program files\python 3.5\lib\site-packages\selenium\webdriver\common\service.py:124: AttributeError
davehunt commented 8 years ago

Duplicate of #1469