1

I have attempted this in a few ways but never have a test after I hit build I have written a test using Nunit and am not sure what I need to do.

using OpenQA.Selenium;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Support.UI;
using System;
using NUnit.Framework;
using OpenQA.Selenium.PhantomJS;

namespace sampletest {
  [TestFixture()]
  public class phantom { 
    [Test()]
    public void TestCase() {
      IWebDriver wd = new RemoteWebDriver(DesiredCapabilities.PhantomJS());
      try {
        wd.Navigate().GoToUrl("https://www.google.com/");
        wd.FindElement(By.Id("lst-ib")).Click();
        wd.FindElement(By.Id("lst-ib")).Clear();
        wd.FindElement(By.Id("lst-ib")).SendKeys("blah");
        wd.FindElement(By.Id("lst-ib")).Click();

        wd.FindElement(By.LinkText("linkedtext")).Click();
        Assert.AreEqual(wd.Title, "PageTitle");
      } finally { wd.Quit(); }
    }
  }
}
Artjom B.
  • 61,146
  • 24
  • 125
  • 222
user1622681
  • 93
  • 16

1 Answers1

0

There are multiple reasons it can happen.

  • make sure you have the NUnit Test Adapter (Nuget is an option for installing that) installed.
  • After that go to TEST-->Test Settings-->Default Processor Architecture and select the correct processor for your machine.
  • Do a BUILD-->Clean Solution and then Build Solution

There are other reasons it may happen. See this

Community
  • 1
  • 1
Saifur
  • 16,081
  • 6
  • 49
  • 73
  • Saifur yes Nunit Test Adapter is installed. I have also tryed not using Nunit Framework withTest Methods and still nothing is this a Visual Studio 2013 issue? – user1622681 Apr 06 '15 at 23:19