This project is read-only.

how to write the assertion for current browser window validation

Jun 7, 2012 at 1: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();
Assert.AreEqual(?,pgHomePage.sWindowTitle);

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

 

Jun 9, 2012 at 3: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);

bWin.Close();

Jun 10, 2012 at 1:22 PM

Thank for your response