public void FromProcess_GetWindowTitle_Succeeds()
        {
            //Arrange
            WebPage.Launch(CurrentDirectory + "/TitleTest.html");

            //Act
            BrowserWindow bWin =
                WebPage.FromProcess(
                    Process.GetProcessesByName("iexplore").Single(x => !string.IsNullOrEmpty(x.MainWindowTitle)));

            //Assert
            Assert.AreEqual("A Test - Windows Internet Explorer", bWin.Title);

            bWin.Close();
        }
        public void FromProcess_FindAllBrowserWindows_CanGetUriAndTitle()
        {
            Process[] processes = Process.GetProcessesByName("iexplore");
            foreach (Process process in processes)
            {
                if (string.IsNullOrEmpty(process.MainWindowTitle))
                {
                    continue;
                }

                BrowserWindow bWin = WebPage.FromProcess(process);

                Trace.WriteLine(string.Format("Found browser window: {0} {1}", bWin.Uri, bWin.Title));
            }
        }