I want to start a Selenium test from within my aspx page. I've installed Selenium with NuGet in my solution.

In the code behind for my webpage I have this:

protected void Page_Load(object sender, EventArgs e)
{
    _driver = new FireFoxDriver();
    _driver.Manage().Window.Maximize();
    _driver.SwitchTo().Window(_driver.CurrentWindowHandle);
    _driver.Manage().Cookies.DeleteAllCookies();
    _driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3));

    _driver.Navigate().GoToUrl("http://www.google.com/");
    _driver.FindElement(By.Id("lst-ib")).SendKeys("ModelTrains");
    _driver.FindElement(By.Id("lst-ib")).SendKeys(Keys.Enter);

    _driver.Quit();

}

The code runs, I can step through it, but I don't see the new window or browser instance, I also don't get any error. What I'm I doing wrong?

Related posts

Recent Viewed