测试人社区

selenium 遇到的问题,chromedriver打开浏览器运行失败

Testing started at 23:26 …
C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe “C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.4\helpers\pycharm_jb_pytest_runner.py” --target test_selenium.py::test_selenium
Launching pytest with arguments test_selenium.py::test_selenium in C:\Users\Administrator\pengketong_lg3\test_selenium

============================= test session starts =============================
platform win32 – Python 3.8.4, pytest-6.0.2, py-1.9.0, pluggy-0.13.1 – C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\Administrator\pengketong_lg3\test_selenium
plugins: allure-pytest-2.8.18
collecting … collected 1 item

test_selenium.py::test_selenium FAILED [100%]
test_selenium.py:2 (test_selenium)
def test_selenium():

  driver = webdriver.Chrome()

test_selenium.py:4:


…\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py:76: in init
RemoteWebDriver.init(
…\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py:157: in init
self.start_session(capabilities, browser_profile)
…\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py:252: in start_session
response = self.execute(Command.NEW_SESSION, parameters)
…\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py:321: in execute
self.error_handler.check_response(response)


self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x000001D5BB465A00>
response = {‘status’: 500, ‘value’: '{“value”:{“error”:“unknown error”,“message”:"unknown error: Devtools port number file conten…\n\tRtlGetAppContainerNamedObjectPath [0x77AE7084+228]

按下图步骤排查一下,你这个应该是chrome的远程调试启动的不正确

他这个不是复用浏览器,昨晚重装chrome好了