1

I have a .NET Core web app that connects to a .NET Core API and I want to run Selenium UI tests against it. However, the Webdriver can only connect to the web app if I first run the web app and API in IISExpress. What's the best way to run them without having to explicitly start them in IIS? I've tried to create a new Process to use 'dotnet' to run the web app (and API) for me but it won't run. Has anyone had a similar problem?

TylerH
  • 20,799
  • 66
  • 75
  • 101
linda
  • 13
  • 3

1 Answers1

0

You'll first want to figure out how to get your application running before trying to test it with Selenium. This post might help you with that. After you figure that part out, you'll want your web application with its server running before you run your Selenium tests against it. This can be accomplished in a number of ways:

  1. Get your server hosted non-locally
  2. Manually starting your server locally and running it prior to running the test
  3. Have your test application build and run your server with a Process instance

If you decide to go with the third option, you'll of course need to find out how to properly get your server running. In my experience, the dotnet build and dotnet run commands usually do the trick. The dotnet build command takes in a SLN or CSPROJ file, then compiles your server's source files and outputs a DLL. You can then specify this DLL in the dotnet run <DLL> command.

TylerH
  • 20,799
  • 66
  • 75
  • 101
natn2323
  • 1,983
  • 1
  • 13
  • 30