gpt4 book ai didi

google-chrome - "Cannot call method ' indexOf ' of undefined"当使用 Google Chrome (*googlechrome) 作为 Selenium RC 目标时

转载 作者:行者123 更新时间:2023-12-01 00:40:46 25 4
gpt4 key购买 nike

我正在尝试使用 Selenium Grid 在 Google Chrome 9.0.597.98 beta 中运行测试。我使用 Selenium Grid 附带的默认 *googlechrome 目标从 C# 启动测试。当我尝试打开网站时,遇到了“无法调用未定义的方法‘indexOf’”错误。

我发现有人发帖建议解决方案是通过传递一些参数来稍微降低 Chrome 的安全性。 This post建议使用这样的东西:


DefaultSelenium selenium = new DefaultSelenium(location, port, browser, targetPath);

BrowserConfigurationOptions bco = new BrowserConfigurationOptions();

selenium.start(bco.setCommandLineFlags("--disable-web-security"));

出于某种原因,我在任何地方都看不到 BrowserConfigurationOptions这是 Selenium dll 附带的东西吗?它是否在 .NET 版本中不可用,但在其他版本中可用?我有哪些选项可以设置此“--disable-web-security”选项?是否有更好的方法?

enter image description here

最佳答案

试试这个

[TestInitialize]

public void PreTest()
{
selenium = new DefaultSelenium("localhost",4444,"googlechrome","http://www.ryanhayes.net")
}


[TestMethod]

public void TestRyanHayesDotNet()
{
selenium.Open("/")

}

在 ryanhayes.net 修复问题后删除/

关于google-chrome - "Cannot call method ' indexOf ' of undefined"当使用 Google Chrome (*googlechrome) 作为 Selenium RC 目标时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4987354/

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