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

调用WIN10 ChromeOption时Selenium Grid Hub/崩溃

江丰羽
2023-03-14

我有一个Selenium集线器,其中6个节点基于该平台注册如下:

>

  • 3平台作为WIN10

    Capabilities {browserName: chrome, extension.sikuliCapability: true, maxInstances: 7, platform: WIN10, platformName: WIN10, seleniumProtocol: WebDriver, server:CONFIG_UUID: ae7939e1-25ff-4030-8baf-efe..., version: ANY}
    

    3平台作为VISTA

    Capabilities {browserName: chrome, extension.sikuliCapability: true, maxInstances: 7, platform: VISTA, platformName: VISTA, seleniumProtocol: WebDriver, server:..., version: ANY}
    

    有没有办法通过提及OSname在平台上调用chrome浏览器,我已经尝试了几个选项,但看起来集线器随机调用驱动器而不是基于操作系统版本。

    任何洞察都会有所帮助。在某些情况下,当我提到WIN10的chrome驱动程序时,chrome驱动器崩溃,如下所示:

    SessionId not found. Running the test locally?
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.webDriver' defined in class path resource [application-context-web.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'getWebDriver' threw exception; nested exception is org.openqa.selenium.SessionNotCreatedException: session not created: No matching capabilities found
    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
    System info: host: '', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
    Driver info: driver.version: unknown
    remote stacktrace: Backtrace:
            Ordinal0 [0x00D7D383+3134339]
            Ordinal0 [0x00C6A171+2007409]
            Ordinal0 [0x00B0AEE8+569064]
            Ordinal0 [0x00AB0358+197464]
            Ordinal0 [0x00AAFDC8+196040]
            Ordinal0 [0x00AB0CB7+199863]
            Ordinal0 [0x00AB0C1D+199709]
            Ordinal0 [0x00AAEB0B+191243]
            Ordinal0 [0x00A92E77+77431]
            Ordinal0 [0x00A93E3E+81470]
            Ordinal0 [0x00A93DC9+81353]
            Ordinal0 [0x00C80CD9+2100441]
            GetHandleVerifier [0x00EEB75A+1396954]
            GetHandleVerifier [0x00EEB3D9+1396057]
            GetHandleVerifier [0x00EF7126+1444518]
            GetHandleVerifier [0x00EEBCE8+1398376]
            Ordinal0 [0x00C77F51+2064209]
            Ordinal0 [0x00C822EB+2106091]
            Ordinal0 [0x00C82411+2106385]
            Ordinal0 [0x00C949C4+2181572]
            BaseThreadInitThunk [0x77306359+25]
            RtlGetAppContainerNamedObjectPath [0x77647C24+228]
            RtlGetAppContainerNamedObjectPath [0x77647BF4+180]
    
    Command duration or timeout: 598 milliseconds
            at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1022)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
            at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
            at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:345)
            at <packagename>.ThreadScope.get(ThreadScope.java:28)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:340)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
            at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35)
            at <packagename>.getTargetObject(PUtils.java:14)
            at <packagename>.setUp(BaseSelTestCase.java:127)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
            at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
            at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
            at org.testng.internal.Invoker.invokeMethod(Invoker.java:589)
            at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
            at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
            at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
            at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'getWebDriver' threw exception; nested exception is org.openqa.selenium.SessionNotCreatedException: session not created: No matching capabilities found
    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
    System info: host: '', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
    Driver info: driver.version: unknown
    remote stacktrace: Backtrace:
            Ordinal0 [0x00D7D383+3134339]
            Ordinal0 [0x00C6A171+2007409]
            Ordinal0 [0x00B0AEE8+569064]
            Ordinal0 [0x00AB0358+197464]
            Ordinal0 [0x00AAFDC8+196040]
            Ordinal0 [0x00AB0CB7+199863]
            Ordinal0 [0x00AB0C1D+199709]
            Ordinal0 [0x00AAEB0B+191243]
            Ordinal0 [0x00A92E77+77431]
            Ordinal0 [0x00A93E3E+81470]
            Ordinal0 [0x00A93DC9+81353]
            Ordinal0 [0x00C80CD9+2100441]
            GetHandleVerifier [0x00EEB75A+1396954]
            GetHandleVerifier [0x00EEB3D9+1396057]
            GetHandleVerifier [0x00EF7126+1444518]
            GetHandleVerifier [0x00EEBCE8+1398376]
            Ordinal0 [0x00C77F51+2064209]
            Ordinal0 [0x00C822EB+2106091]
            Ordinal0 [0x00C82411+2106385]
            Ordinal0 [0x00C949C4+2181572]
            BaseThreadInitThunk [0x77306359+25]
            RtlGetAppContainerNamedObjectPath [0x77647C24+228]
            RtlGetAppContainerNamedObjectPath [0x77647BF4+180]
    
    Command duration or timeout: 598 milliseconds
            at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
            at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
            ... 26 more
    Caused by: org.openqa.selenium.SessionNotCreatedException: session not created: No matching capabilities found
    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
    System info: host: 'XGHSGHSG', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
    Driver info: driver.version: unknown
    remote stacktrace: Backtrace:
            Ordinal0 [0x00D7D383+3134339]
            Ordinal0 [0x00C6A171+2007409]
            Ordinal0 [0x00B0AEE8+569064]
            Ordinal0 [0x00AB0358+197464]
            Ordinal0 [0x00AAFDC8+196040]
            Ordinal0 [0x00AB0CB7+199863]
            Ordinal0 [0x00AB0C1D+199709]
            Ordinal0 [0x00AAEB0B+191243]
            Ordinal0 [0x00A92E77+77431]
            Ordinal0 [0x00A93E3E+81470]
            Ordinal0 [0x00A93DC9+81353]
            Ordinal0 [0x00C80CD9+2100441]
            GetHandleVerifier [0x00EEB75A+1396954]
            GetHandleVerifier [0x00EEB3D9+1396057]
            GetHandleVerifier [0x00EF7126+1444518]
            GetHandleVerifier [0x00EEBCE8+1398376]
            Ordinal0 [0x00C77F51+2064209]
            Ordinal0 [0x00C822EB+2106091]
            Ordinal0 [0x00C82411+2106385]
            Ordinal0 [0x00C949C4+2181572]
            BaseThreadInitThunk [0x77306359+25]
            RtlGetAppContainerNamedObjectPath [0x77647C24+228]
            RtlGetAppContainerNamedObjectPath [0x77647BF4+180]
    

    节点注册如下:

    {
      "capabilities":
      [{
              "seleniumProtocol": "WebDriver",
              "browserName": "firefox",
              "maxInstances": 4,
              "version": "ANY",
              "platform": "WIN10",
              "firefox_binary":"C:\\Program Files\\Mozilla Firefox\\firefox.exe",
              "extension.sikuliCapability": true
            },
            {
              "seleniumProtocol": "WebDriver",
              "browserName": "chrome",
              "maxInstances": 7,
              "version": "ANY",
              "platform": "WIN10"
            },
            {
              "seleniumProtocol": "WebDriver",
              "browserName": "internet explorer",
              "maxInstances": 1,
              "version": "11",
              "platform": "WIN10"
            },
            {
              "seleniumProtocol": "WebDriver",
              "browserName": "MicrosoftEdge",
              "maxInstances": 1,
              "version": "ANY",
              "platform": "WIN10"
        }
      ],
      "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
      "maxSession": 7,
      "port": 5555,
      "register": true,
      "registerCycle": 5000,
      "hub": "http://hubname:4444/hub/wd/",
      "nodeStatusCheckTimeout": 5000,
      "nodePolling": 5000,
      "role": "node",
      "unregisterIfStillDownAfter": 60000,
      "downPollingLimit": 2,
      "debug": false,
    }
    

    {
      "capabilities":
      [{
        "seleniumProtocol": "WebDriver",
        "browserName": "firefox",
        "maxInstances": 4,
        "version": "ANY",
        "marionette":true,
        "platform": "VISTA",
        "platformName": "VISTA",
        "firefox_binary":"C:\\Program Files\\Mozilla Firefox\\firefox.exe",
        "extension.sikuliCapability": true
      },
        {
          "seleniumProtocol": "WebDriver",
          "browserName": "chrome",
          "maxInstances": 7,
          "version": "ANY",
          "platform": "VISTA",
          "extension.sikuliCapability": true
        }
      ],
      "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
      "maxSession": 7,
      "port": 5555,
      "register": true,
      "registerCycle": 5000,
      "hub": "http://callisto.quiacorp.com:4444/hub/wd/",
      "nodeStatusCheckTimeout": 5000,
      "nodePolling": 5000,
      "role": "node",
      "unregisterIfStillDownAfter": 60000,
      "downPollingLimit": 2,
      "debug": false,
      "servlets" : ["io.sterodium.extensions.node.SikuliExtensionServlet","io.sterodium.extensions.node.upload.FileUploadServlet","io.sterodium.extensions.node.download.FileDownloadServlet"],
      "withoutServlets": [],
      "custom": {}
    }
    

    如果能帮助解决这个问题,我们将不胜感激。

  • 共有1个答案

    班展
    2023-03-14

    此错误消息...

    SessionId not found. Running the test locally?
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.webDriver' defined in class path resource [application-context-web.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'getWebDriver' threw exception; nested exception is org.openqa.selenium.SessionNotCreatedException: session not created: No matching capabilities found
    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
    System info: host: '', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_101'
    Driver info: driver.version: unknown
    

    ...暗示ChromeDriver无法与浏览上下文(即WIN10上的浏览器会话)进行通信

    您的主要问题是您正在使用的二进制文件版本之间的不兼容性,如下所示:

      < li >尽管您使用的是Selenium版本:< code >“3 . 141 . 59 ”。 < li >你的< code > Java . version:' 1 . 8 . 0 _ 101 ' 哪个老,哪个古。

    确保:

    • JDK已升级到当前级别JDK 8u251
     类似资料:
    • 希望你做得很好。 我有一个C语言的JNI实现,其中一个C函数连接到当前JVM线程并回调一个Java方法,这实际上是在attachCurrentThread()函数调用时使JVM崩溃。我的实现基于链接中给出的答案,保持对JNIEnv环境的全局引用 线程创建部分,它将侦听套接字连接以接受事件并注入GetEvent函数。 回调函数 在接收到事件时执行GetEvent()后,我的JVM在AttachMon

    • 我目前正在使用OpenGL和GLFW开发一个跨平台的2D渲染引擎。我有一个名为GameWindow的基本窗口类,以及一个名为Game的继承GameWindow的类。游戏覆盖了基类中的一些虚拟方法,以便GameWindow可以处理帧限制等。在GameWindow的构造函数中,我使用glfwSetWindowSizeCallback指定窗口调整大小时要运行的方法。然后,此方法调用GameWindow的

    • 问题内容: 这是启动桌面版本时得到的: 我都试过这个政党成员和这一个,我也得到了同样的错误在同一直线上。 编辑: 我只是注意到我的.tmx文件的数据是由Tiled Map Editor自动编码的,所以我只是停用了它,但仍然遇到相同的错误。 如果我复制/粘贴该项目(我的意思是整个项目,不仅是render()方法),它会工作,但是当我尝试在自己的项目中加载自己的地图时,它只会崩溃… 因此,在那之后,我

    • 问题内容: 当在此应用程序中的iPhone上调用UIActivityViewController时,它可以正常工作,但在iPad上调用时,该应用程序崩溃。下面是我使用的代码: 如您所见,我正在使用SpriteKit Framework在Swift中进行编程,但我不明白为什么应用程序崩溃。 我收到此错误: 我该怎么做才能解决此问题? 问题答案: 在展示之前,添加以下代码行: 这样,视图控制器便知道要

    • 我试图使用ModCoderPack为1.8.8创建一个客户机,但是当我试图调用任何在同一个类中不存在的函数时,比如MC.DisplayGuisCreen,游戏就崩溃了。我有等待按键的代码 该函数在Minecraft.java中调用 以下是客户端类的全部代码 代码: 崩溃日志 编辑:它在将Minecraft实例传递给函数时工作

    • 我在Android中使用JNI时遇到了一个奇怪的问题。我获得了我的类SecureChannel的对象方法sendClearMessage()并调用了这个返回类MessageResponse的对象的方法。这个对象被分配给jobject,然后传递给CallObjectMethod以调用该类的一个方法。每当我调用这个类的方法时,应用程序就会在没有有用信息的情况下崩溃。我检查每个获得jmethodID或j