Automatically start an ASP.MVC project when starting a test project

I am trying to set up a test project for my ASP website. For some tests, I want to use selenium to do end-to-end tests.

Therefore, my site must be running so that tests can access the site.

How can I start a project of my site when running tests?

+5
source share
1 answer

Please refer to the following links. I believe it is possible, but it will be a little more difficult. They are detailed and provide information on how to do this programmatically.

Starting and stopping IIS Express programmatically

https://www.reimers.dk/jacob-reimers-blog/testing-your-web-application-with-iis-express-and-unit-tests

  • The idea is that you will need to run it and go to your specific local application in the browser.
  • Then you will need to get the window handle of the open browser window
  • Then create an instance of the Driver object and use the window handle for that instance to force Selenium to run in an open window.
+5
source

Source: https://habr.com/ru/post/1200236/


All Articles