title: VSTS is it possible to run selenium UI test tasks against localhost web app?
body: <p>I might be missing something obvious here but my mvc web app is successfully tested using specflow UI tests on my dev machine using localhost but I can't get this to work on a CI Build pipeline in VSTS?</p>
  
  <p>Here is my setup, 1 x Asp.Net solution comprising of:</p>
  
  <ul>
  <li>1 x WebCalculator (MVC app that simply adds 2 numbers together)</li>
  <li>1 x UI Specflow tests project</li>
  </ul>
  
  <p>On my Dev machine: I can run the unit tests using NUnit3TestAdapter within visual studio, with my website running at localhost:58909</p>
  
  <p>On VSTS: After the build task, the Visual Studio Test Task is picking up the NUnit Adapter and tries to run the tests (using InternetExplorerDriver server) but fails to find my website running on localhost it seems:</p>
  
  <p>Here's the output:</p>
  
  <pre><code>2017-04-03T09:02:31 Starting test execution, please wait...
  2017-04-03T09:02:32 Information: NUnit Adapter 3.7.0.0: Test execution started
  2017-04-03T09 Information: Running all tests in C:\a\1\s\WebCalculator.UiTestsNUnitRunner\bin\Release\WebCalculator.UiTestsNUnitRunner.dll
  2017-04-03T09:02:32 Information: NUnit3TestExecutor converted 3 of 3 NUnit test cases
  2017-04-03T09:02:33  Started InternetExplorerDriver server (32-bit)
  2017-04-03T09:02:33  3.0.0.0
  2017-04-03T09:02:33  Listening on port 1065
  2017-04-03T09:02:33  Only local connections are allowed
  2017-04-03T09:03:54  Started InternetExplorerDriver server (32-bit)
  2017-04-03T09:03:54  3.0.0.0
  2017-04-03T09:03:54  Listening on port 1123
  2017-04-03T09:03:54  Only local connections are allowed
  2017-04-03T09:03:54  Failed   AddTwoNumbers("50","70","120",System.String[])
  2017-04-03T09:03:54  ##[error]Error Message:
  2017-04-03T09:03:54  ##[error]   OpenQA.Selenium.WebDriverTimeoutException : Timed out after 10 seconds
  2017-04-03T09:03:54  ##[error]  ----&gt; OpenQA.Selenium.NoSuchElementException : Unable to find element with id == summandOne
  </code></pre>
  
  <p>So my question, is the Visual Studio Test Task smart enough to test against my website which is built as part of the solution at localhost:58909 ?</p>
  
  <p>The example from MS here: <a href="https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-selenium" rel="nofollow noreferrer">https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-selenium</a></p>
  
  <p>Has the Specflow tests pointing at an XXX.azurewebsites.net url so I'm starting to think that building the website and executing the UI tests together (like I'm attempting) isn't the right approach for this?</p>
  
  <p>Is it the case that when you want to run Specflow tests against a website - I need to build and release this to a hosted environment first??</p>