Skip to content

Switching between windows after navigating to another URL fails on FireFox #9

Description

@arnonax

Note: this works fine on Chrome, but fails on Firefox.

Repro:

using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Firefox;
using TestAutomationEssentials.Common.ExecutionContext;
using TestAutomationEssentials.MSTest;
using TestAutomationEssentials.Selenium;

namespace IgudTest
{
    [TestClass]
    public class UnitTest1 : TestBase
    {
        [TestMethod]
        public void TestMethod1()
        {
            var driver = new FirefoxDriver();
            AddCleanupAction(() => driver.Quit());
            var browser = new Browser("Main Window", driver, TestExecutionScopesManager);
            var mainWindow = browser.MainWindow;
            driver.Url = @"file:///C:/temp/FirstWindow.html";
            var link = browser.WaitForElement(By.Id("myLink"), "Link");
            var newWindow = browser.OpenWindow(() => link.Click(), "New window");
            Console.WriteLine(newWindow.Title);
            Assert.AreEqual(mainWindow.Title, driver.Title);
        }
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions