【发布时间】:2017-12-07 05:35:04
【问题描述】:
我正在尝试使用 Selenium Webdriver 和 C#.Net 为 Firefox 浏览器运行一些单元测试,但我无法做到(Chrome 和 IE11 浏览器运行顺畅)。
这是我收集的信息:
操作系统:Windows 10 企业版
Gecko驱动版本:geckodriver-v0.17.0-win32
Mozilla Firefox 版本:54.0.1(32 位)
环境路径变量已在“C:\LEO\SELENIUM C#\Firefox”下设置
代码片段:
using System;
using System.Text;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
using OpenQA.Selenium.Firefox;
[TestFixture]
public class UnitTest3
{
private IWebDriver driver;
private StringBuilder verificationErrors;
private string baseURL;
[SetUp]
public void SetupTest()
{
FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"C:\LEO\SELENIUM C#\Firefox");
service.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";
driver = new FirefoxDriver(service);
baseURL = "http://www.dow.com";
verificationErrors = new StringBuilder();
}
}
错误:
消息:OpenQA.Selenium.WebDriverException:无法找到匹配的功能集。
TearDown : System.NullReferenceException : 对象引用未设置为对象的实例。
堆栈跟踪:
感谢您的帮助,谢谢。
【问题讨论】:
-
曾经能够绕过它吗?
标签: c# selenium firefox selenium-webdriver geckodriver