how to write the assertion for current browser window validation

Jun 7, 2012 at 12:02 PM

I have to validate my current browser is displaying the correct window or not ? How to write the assertion for this for window title ?

HomePage pgHomePage = CUITe_BrowserWindow.GetBrowserWindow();

  how to capture the current browser window title for my assertion ?


Jun 9, 2012 at 2:42 AM

Changeset #17145 has a unit test called BrowserWindow_GetExistingBrowserWindow_Succeeds which demonstrates this functionality:


CUITe_BrowserWindow.Launch(CurrentDirectory + "/TestHtmlPage.html");

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

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


Jun 10, 2012 at 12:22 PM

Thank for your response