Created
February 12, 2017 05:01
-
-
Save matthewrwilton/33de0ae07c82a2641ea8a306d65a6f80 to your computer and use it in GitHub Desktop.
Code snippet for blog from https://github.com/matthewrwilton/SeleniumExamples/blob/master/SeleniumExamples/_2_Running_A_Web_App.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Collection(nameof(WebAppFixture))] | |
public class _2_Running_A_Web_App | |
{ | |
/* | |
* This is a bare minimum example of starting IIS Express to run a web application for testing. | |
* It uses xUnit collection fixtures to start the web application before running the test. | |
* Only a single instance of the application is started and is shared between all tests in the collection. | |
*/ | |
[Fact] | |
public void Run_Application_And_Navigate_To_Home_Page() | |
{ | |
using (var driver = new ChromeDriver(ProjectDirectories.GetDriversDirectory())) | |
{ | |
driver.Navigate().GoToUrl("http://localhost:59837/Home/Index"); | |
driver.FindElementById("hello"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment