(我的firefox版本是Mozilla Firefox 63.0,所以它与here中的问题不同)
跟随https://www.obeythetestinggoat.com/book/chapter_01.html书时,出现以下错误。
Traceback (most recent call last):
File "functional_tests.py", line 3, in <module>
browser = webdriver.Firefox()
File "/mnt/c/Users/connect/Desktop/python-tdd-book/virtualenv/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
keep_alive=True)
File "/mnt/c/Users/connect/Desktop/python-tdd-book/virtualenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "/mnt/c/Users/connect/Desktop/python-tdd-book/virtualenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/mnt/c/Users/connect/Desktop/python-tdd-book/virtualenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/mnt/c/Users/connect/Desktop/python-tdd-book/virtualenv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process
运行“ pythonfunctional_tests.py”时。
其中包含以下代码
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://localhost:8000')
assert "Django" in browser.title
我还要指出,我在Windows 10上运行Ubuntu Bash。
硒3.141.0
geckodriver 0.23.0
Python 3.6.6