title: Testing local project in Visual Studio using selenium web driver
body: <p>I am trying to set up a visual studio project with acceptance tests using NUnit and Selenium Web Driver, I would like to be able to "run tests" and this to start my web site, use selenium to run the tests and quit.</p>
  
  <p>I have this basic setup so far:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using NUnit.Framework;
  using OpenQA.Selenium;
  using OpenQA.Selenium.PhantomJS;
  
  namespace FrontEndTests.AcceptanceTests
  {
  [TestFixture]
  class Phantom
  {
      private PhantomJSDriver _driver;
  
      [SetUp]
      public void WhenOpeningANewWebPage()
      {
          _driver = new PhantomJSDriver();
          _driver.Navigate().GoToUrl(@"localhost");
      }
  
      [Test]
      public void ThenICanFindAClass()
      {
          Assert.NotNull(_driver.FindElement(By.ClassName("featured")));
      }
  
      [TearDown]
      public void Finally()
      {
          _driver.Quit();
      }
  
  }
  }
  </code></pre>
  
  <p>If I set the URL to 'www.google.com' the tests pass fine (with the correct class set) but localhost returns elementnotfoundexception in selenium.</p>
  
  <p>How do I get it to work locally?</p>
  
  <p>Thanks</p>