私は WebDriver を初めて使用し、このコードを C# Visual Studio (以下のコード スニペット) で記述しています。IsElementPresent を使用して、ホーム ページにテキスト フィールドが存在するかどうかを確認しています。The name IsElementPresent does not exist in the current context というエラーが表示されます。私は何を間違っていますか?
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Support.UI;
namespace Homepage_check2
{
[TestFixture]
public class Driver
{
IWebDriver driver;
[SetUp]
public void Setup()
{
// Create a new instance of the Firefox driver
driver = new FirefoxDriver();
}
[TearDown]
public void Teardown()
{
driver.Quit();
}
[Test]
public void homepage()
{
//Navigate to the site
driver.Navigate().GoToUrl("http://www.milkround.com");
Assert.IsTrue(IsElementPresent(By.Id("ctl00_uxToolbar_uxQueryTextBoxToolbar")));
}
catch
{
//verificationErrors.Append(e.Message);
}
}
}
}