【发布时间】:2015-08-29 01:40:13
【问题描述】:
我正在尝试通过运行一些示例来开始使用 Selenium。我见过其他人在运行 InternetExplorerDrive 时遇到问题,请参阅How to instantiate InternetExplorerDriver with Selenium WebDriver using C#,但我的问题不同。我收到一个无法找到 InternetExlorerDriver 的编译时错误。我已经在我的项目中安装了所有四个“官方 NuGet 包:RC WebDriver WebDriverBackedSelenium 支持”。
我也将 IEDriverServer.exe 添加到项目中,但我还没有做到这一点。
我缺少什么参考资料?
using System;
using System.Threading;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
namespace SeleniumTest
{
class Program
{
static void Main(string[] args)
{
// Create a new instance of the Firefox driver.
// Notice that the remainder of the code relies on the interface,
// not the implementation.
// Further note that other drivers (InternetExplorerDriver,
// ChromeDriver, etc.) will require further configuration
// before this example will work. See the wiki pages for the
// individual drivers at http://code.google.com/p/selenium/wiki
// for further information.
IWebDriver driver = new InternetExlorerDriver(); //missing reference error here
编译时错误:
Error 1 The type or namespace name 'InternetExlorerDriver' could not be found (are you missing a using directive or an assembly reference?) c:\users\chadd\documents\visual studio 2013\Projects\SeleniumWebDr\SeleniumTest\Program.cs 22 37 SeleniumTest
【问题讨论】:
-
忽略它并运行视觉工作室一段时间会给出无用的参考错误:-)
标签: c# selenium selenium-webdriver