Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Windows边缘webdriver因WebDriverException失败:消息:未知错误_Python_Selenium_Microsoft Edge_Circleci_Python Behave - Fatal编程技术网

Python Windows边缘webdriver因WebDriverException失败:消息:未知错误

Python Windows边缘webdriver因WebDriverException失败:消息:未知错误,python,selenium,microsoft-edge,circleci,python-behave,Python,Selenium,Microsoft Edge,Circleci,Python Behave,我试图在CircleCI中的Windows Edge上运行behave测试,但即使是简单的测试也无法初始化具有 Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\circleci\AppData\Roaming\Python\Python36\site-packages\selenium\webdriver\edge\webdriver.py

我试图在CircleCI中的Windows Edge上运行
behave
测试,但即使是简单的测试也无法初始化具有

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\circleci\AppData\Roaming\Python\Python36\site-packages\selenium\webdriver\edge\webdriver.py", line 66, in __init__
    desired_capabilities=capabilities)
  File "C:\Users\circleci\AppData\Roaming\Python\Python36\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\circleci\AppData\Roaming\Python\Python36\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\circleci\AppData\Roaming\Python\Python36\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\circleci\AppData\Roaming\Python\Python36\site-packages\selenium\webdriver\remote\errorhandler.py", line 208, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: Unknown error
然后我ssh到机器上进行调试并尝试

python -c "from selenium import webdriver; webdriver.Edge()"
这将导致上述错误。web驱动程序的路径正确,不正确的路径将导致另一个错误

已经试过了
  • 关闭UAC(使用cmd.exe):
  • 正在尝试使用Chrome设置进行连接:
  • 亲自陈述服务器:

    /c/tools/selenium/MicrosoftWebDriver.exe
    [14:48:13.545] - Listening on http://localhost:17556/
    
    这会导致401错误错误请求,或者如果我更新了
    所需的\u功能
    类似于:

    selenium.common.exceptions.SessionNotCreatedException: Message: session not created: No matching capabilities found
    
  • 尝试将边缘二进制文件更改为中的最新版本,但仍然存在相同问题

  • 目前,无法在CircleCI映像上安装Edge。但如果像BrowserStack这样的服务不适合您,那么有一种方法可以在您自己的/AWS机器上使用Windows/Edge运行Selenium,并部署一个官方的流浪者映像

  • 下载(流浪汉就可以了)
  • 如果您计划使用AWS检查在EC2上部署映像
  • 在流浪汉图像上安装Selenium。您可以尝试使用Puppet,检查,但它使用了过时的边缘版本,您需要更新
  • 花些时间设置权限/角色和其他IAM内容,以便能够从CircleCI连接到EC2
  • 现在使用
    webdriver.Remote
    您可以连接到安装了Edge和web驱动程序的Selenium(集线器或单机版)

  • 目前,无法在CircleCI映像上安装Edge。但如果像BrowserStack这样的服务不适合您,那么有一种方法可以在您自己的/AWS机器上使用Windows/Edge运行Selenium,并部署一个官方的流浪者映像

  • 下载(流浪汉就可以了)
  • 如果您计划使用AWS检查在EC2上部署映像
  • 在流浪汉图像上安装Selenium。您可以尝试使用Puppet,检查,但它使用了过时的边缘版本,您需要更新
  • 花些时间设置权限/角色和其他IAM内容,以便能够从CircleCI连接到EC2
  • 现在使用
    webdriver.Remote
    您可以连接到安装了Edge和web驱动程序的Selenium(集线器或单机版)

  • 您是否尝试停止并重新启动服务?您的Microsoft Edge版本和Microsoft Edge WebDriver版本是什么?在上,它表示要在Windows计算机上运行作业,必须将
    Windows
    键添加到作业的顶级配置中。此外,请注意,通过SSH连接到Windows作业并使用
    bash
    shell会导致空的终端提示。您是否尝试停止并重新启动服务?您的Microsoft Edge版本和Microsoft Edge WebDriver版本是什么?在上,它表示要在Windows计算机上运行作业,必须将
    Windows
    键添加到作业的顶级配置中。此外,请注意,通过SSH连接到Windows作业并使用
    bash
    shell会导致一个空的终端提示。
    /c/tools/selenium/MicrosoftWebDriver.exe
    [14:48:13.545] - Listening on http://localhost:17556/
    
    python -c "from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver; from selenium.webdriver.common.desired_capabilities import DesiredCapabilities; from selenium.webdriver.chrome.remote_connection import ChromeRemoteConnection; rwd = RemoteWebDriver(command_executor=ChromeRemoteConnection(remote_server_addr='http://localhost:17556', keep_alive=False))"
    
    selenium.common.exceptions.SessionNotCreatedException: Message: session not created: No matching capabilities found