Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically start ASP.MVC project when running test project

I'm trying to set up a test project for my ASP website. For some tests I want to use selenium to perform end-to-end tests.

Therefor my website has to be running so the tests can access the site.

How can I start my website project when I run tests?

like image 543
Martin Walter Avatar asked Aug 13 '14 15:08

Martin Walter


1 Answers

Please reference the following links. I believe it is possible, but will be a little tricky. These are detailed and provide information on doing 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 would need to start it and navigate to your particular local app in your browser.
  • Then you will need to get the window handle of the open browser window
  • Then instantiate your Driver object and use the window handle for that instantiation to get Selenium to execute on the open window.
like image 120
mutt Avatar answered Sep 27 '22 22:09

mutt