Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arnonax opened this issue Oct 25, 2018 · 0 comments

Comments

@arnonax
Copy link
Owner

arnonax commented Oct 25, 2018

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);
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant