selenium

Selenium simple example C# and Nunit

Simple page load test and make sure the title of the page is correct

public class HomepageTests
{
    private IWebDriver _driver;
    
    [SetUp]
    public void LoadDriver()
    {
       _driver = new ChromeDriver();
       
    }

    [Test]
    public void Valid_Home_Page_Title()
    {
        _driver.Navigate().GoToUrl("Your homeoage url / local or remote");
        StringAssert.Contains("Expected title of your page", _driver.Title);

    }

    [TearDown]
    public void UnloadDriver()
    {
        _driver.Quit();
    }
}

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow