TestStack / TestStack.Seleno

Seleno helps you write automated UI tests in the right way by implementing Page Objects and Page Components and by reading from and writing to web pages using strongly typed view models.
http://teststack.github.com/TestStack.Seleno/
MIT License
180 stars 60 forks source link

Changing the IIS express base URL #241

Closed imilchev closed 8 years ago

imilchev commented 8 years ago

Hi there,

I want to host my project on IIS express but change the base URL (so it does not go to localhost:port, but somewhere else). This is needed due to my configuration but I cannot find a way to do it with Seleno. Is it possible to change the base URL somehow or another way to force Seleno to host the solution and after that go to a remote URL?

Thanks in advance!

robdmoore commented 8 years ago

You could create a custom applicationhost.config file to contain the binding that you want as per http://stackoverflow.com/questions/4709014/using-custom-domains-with-iis-express

You can then either submit a pull request to TestStack.Seleno to allow the config to be overridden as per http://stackoverflow.com/questions/8914461/specify-template-applicationhost-config-when-launching-iis-express or simply create your own web server class with that functionality.

The class you need to modify/copy is https://github.com/TestStack/TestStack.Seleno/blob/master/src/TestStack.Seleno/Configuration/WebServers/IisExpressWebServer.cs.

imilchev commented 8 years ago

Thanks a lot! I created my own implementation as you suggested and it works perfectly!