当前位置: 首页 > 知识库问答 >
问题:

带behat的selenium:找不到会话的提供程序

唐景山
2023-03-14

因此,我试图在docker容器中配置selenium,以便与behat一起使用,当我到达http://localhost:4444/status时,集线器的状态为未就绪:

{
  "value": {
    "ready": false,
    "message": "Selenium Grid not ready.",
    "nodes": [
      {
        "id": "f746de23-58e4-499d-85fd-9bad4f904488",
        "uri": "http:\u002f\u002f172.22.0.5:5555",
        "maxSessions": 2,
        "stereotypes": [
          {
            "capabilities": {
              "browserName": "chrome"
            },
            "count": 2
          }
        ],
        "sessions": [
        ]
      }
    ]
  }
}

当我运行测试时:

Could not open connection: Payload received from webdriver is valid but unexpected json: {
        "value": {
          "error": "session not created",
          "message": "Unable to find provider for session: Capabilities {browser: firefox, browserName: chrome, ignoreZoomSetting: false, name: Behat feature suite, tags: [509f70556c1c, PHP 7.4.9]}, Capabilities {browserName: chrome}, Capabilities {browserName: firefox}, Capabilities {}\nBuild info: version: '4.0.0-alpha-7', revision: '117b9d61c9'\nSystem info: host: '7f39dcd595c7', ip: '172.22.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_265'\nDriver info: driver.version: unknown",
          "stacktrace": "org.openqa.selenium.SessionNotCreatedException: Unable to find provider for session: Capabilities {browser: firefox, browserName: chrome, ignoreZoomSetting: false, name: Behat feature suite, tags: [509f70556c1c, PHP 7.4.9]}, Capabilities {browserName: chrome}, Capabilities {browserName: firefox}, Capabilities {}\nBuild info: version: '4.0.0-alpha-7', revision: '117b9d61c9'\nSystem info: host: '7 (Behat\Mink\Exception\DriverException)
version: '3'

services:
  chrome:
    image: selenium/node-chrome:4.0.0-alpha-7-prerelease-20200907
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
    ports:
      - "6900:5900"

  selenium-hub:
    image: selenium/hub:4.0.0-alpha-7-prerelease-20200907
    container_name: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"
    restart: always
extensions:
    Behat\MinkExtension:
        base_url: "http://localhost"
        browser_name: 'chrome'
        sessions:
            my_session:
                selenium2:
                    wd_host: "http://selenium-hub:4444"
                    browser: chrome
                    capabilities: { "browserName": "chrome"}
    FriendsOfBehat\SymfonyExtension: null

你知道吗?谢谢。

共有1个答案

薛博赡
2023-03-14

我让它与以前的版本一起工作,chrome Selenium/node-chrome:3.141.59-oxygen的图像。我必须更改behat.yml中的base_url作为WebServer的容器“url”。(http://nginx是我的案子)

 类似资料:
  • 问题内容: 我正在尝试将Entity Framework与MySQL配合使用,但出现上述错误。我安装了最新的MySQL连接器。 完整错误为: 但是,我找不到任何建议说明您如何在“ entityFramework”部分中进行注册的内容。 其他一些帖子(例如)建议将提供程序添加到该 部分中,如下所示: 但这不起作用,因为它声称名称是重复的。而且,如果我实际上遍历了,我可以看到最后一个是MySQL提供程

  • 我正在使用Selenium Grid。我最近将VM(node)更新到Windows 10,它不再工作了。以下是详细信息 我通过以下方式将此VM Win10注册为网格节点: (这之前与VM Win8一起工作得很好)我可以在网格上看到这个VM Win10注册了3个浏览器IE11、FF和Chrome 在我的代码中,我通过以下方式创建web驱动程序: 我总是得到这个错误当我执行测试 转发新会话时出错,无法

  • 问题内容: 我正在尝试使用bouncycastle使用公共密钥来加密文件。我已经通过编程方式注册了提供程序: 我成功创建了公共密钥对象。 当我使用PGPEncryptedDataGenerator和密钥加密文件时,出现ClassNotFound异常。 似乎提供程序在运行时找不到此类,尽管我确定我有它的jar … 我在Tomcat上运行我的应用程序。使用Maven处理依赖关系- 我放入的充气城堡ja

  • 问题内容: 通过多个实例扩展Web应用程序是Azure云的最大优势之一。为了实现对我们的Web角色云应用程序的多个VM支持,我们正在实现Azure Redis缓存。我们正在使用RedisSessionStateProvider提供程序来维护会话状态。以下是web.config文件中会话管理的配置设置。 我们的问题是会话超时不会随着用户的回发而延长,假设我们的用户在10:00 AM登录到应用程序,那

  • 问题内容: 我收到以下错误 服务等级 DAO类 我在我的application-context.xml中有这个 谁能发现我为什么出现以下错误? 问题答案: 您使用@Transactional为Dao类添加了注释,但没有为服务类添加注释。该行: 要求您进行交易。 您可以通过将@Transactional批注添加到ProfileService类,或者只添加registerVisitor()方法来解决此

  • 在nuget下载EF6并尝试运行我的项目后,它返回以下错误: 找不到具有固定名称“System.Data.SqlClient”得ADO.NET提供程序得实体框架提供程序.确保在应用程序配置文件的“Entity Framework”部分中注册了提供程序。有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=260882。