gpt4 book ai didi

c# - 无效参数 : Unsupported locator strategy: null - with chrome driver 76. 0.3809.126

转载 作者:太空宇宙 更新时间:2023-11-03 14:39:49 24 4
gpt4 key购买 nike

出现以下错误:

invalid argument: Unsupported locator strategy: null
(Session info: chrome=76.0.3809.132)
(Driver info: chromedriver=76.0.3809.126
(d80a294506b4c9d18015e755cee48f953ddc3f2f-refs/branch-heads/3809@{#1024}),
platform=Windows NT 10.0.18362 x86_64)

在运行我的测试时,相同的代码在 chromedriver-75.0.3770.8 上运行良好。是否需要为 chrome 驱动程序 76.0.3809.126 添加任何功能?

将 selenium 包从 3.7.0 升级到 3.7.10,但没有成功。

将 chrome 驱动程序降级到 775.0.3770.8,它工作正常。

尝试添加 SetCapability(CapabilityType.AcceptSslCertificates, true); 但没有成功

driver.findElement(By.XPath("//div[@class='toggle__nav']/span")).click();

最佳答案

我在使用 chrome 驱动程序版本 77.0.3865.40 时遇到了同样的错误。

但是这次在尝试在框架内查找元素时发生错误。 (在使用 driver.SwitchTo().Frame([iframe IWebElement]); 之后)

它发生在某些帧上,而不会发生在其他帧上。

我能够想出的唯一解决方法是注入(inject) javascript 来执行需要在框架内实现的操作。例如,单击一个按钮...

((IJavaScriptExecutor) driver).ExecuteScript("arguments[0].contentWindow.document.findElementsByTagName('button')[0].click();", [iframe IWebElement]);

如果有人能够首先阐明为什么会出现此错误以及真正的解决方法是什么,那就太好了。

关于c# - 无效参数 : Unsupported locator strategy: null - with chrome driver 76. 0.3809.126,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57675794/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com