我正在尝试使用 Selenium Grid 在 Google Chrome 9.0.597.98 beta 中运行测试。我使用 Selenium Grid 附带的默认 *googlechrome 目标从 C# 启动测试。当我尝试打开一个站点时,我遇到了“无法调用未定义的方法'indexOf'”错误。
我发现有人建议解决方案是通过传递一些参数来稍微降低 Chrome 的安全性。 这篇文章建议使用这样的东西:
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”选项,有没有更好的方法呢?