Selenium Django/Python错误:找不到匹配的功能集

Selenium Django/Python错误:找不到匹配的功能集,python,django,selenium,Python,Django,Selenium,在使用selenium的聊天应用程序上运行此Django测试 tests.py 当我运行测试时,我得到了这个错误 (chatenv) muiruri_samuel@train:~/webapp/chatsys$ python manage.py test chat.tests /home/muiruri_samuel/webapp/chatenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

在使用selenium的聊天应用程序上运行此Django测试

tests.py 当我运行测试时,我得到了这个错误

(chatenv) muiruri_samuel@train:~/webapp/chatsys$ python manage.py test chat.tests
/home/muiruri_samuel/webapp/chatenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:
/usr/local/games:/snap/bin
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
E
======================================================================
ERROR: setUpClass (chat.tests.ChatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/muiruri_samuel/webapp/chatsys/chat/tests.py", line 17, in setUpClass
    cls.driver = webdriver.Firefox()
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py"
, line 170, in __init__
    keep_alive=True)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
 line 156, in __init__
    self.start_session(capabilities, browser_profile)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
 line 245, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
 line 314, in execute
    self.error_handler.check_response(response)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities


----------------------------------------------------------------------
Ran 0 tests in 1.012s

FAILED (errors=1)
Destroying test database for alias 'default'...
结果表明firefox没有正确配置。这也在ubuntu虚拟机服务器上运行


我在一篇文章中查看了如何解决这个问题,文章建议在Firefox中添加一些参数以使其正常工作。从文章中还可以看出,它是为windows配置的,情况似乎不太一样。

您尝试过解决方案吗?->更新selenium和firefoxworked,实际上是要注意服务器在我安装firefox后没有安装firefox,这解决了问题。好的!祝你考试顺利:)
(chatenv) muiruri_samuel@train:~/webapp/chatsys$ python manage.py test chat.tests
/home/muiruri_samuel/webapp/chatenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:
/usr/local/games:/snap/bin
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
E
======================================================================
ERROR: setUpClass (chat.tests.ChatTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/muiruri_samuel/webapp/chatsys/chat/tests.py", line 17, in setUpClass
    cls.driver = webdriver.Firefox()
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py"
, line 170, in __init__
    keep_alive=True)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
 line 156, in __init__
    self.start_session(capabilities, browser_profile)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
 line 245, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py",
 line 314, in execute
    self.error_handler.check_response(response)
  File "/home/muiruri_samuel/webapp/chatenv/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities


----------------------------------------------------------------------
Ran 0 tests in 1.012s

FAILED (errors=1)
Destroying test database for alias 'default'...