Browser window trouble

Aug 24, 2012 at 9:47 AM

Hi All,

I'm hoping you can help. I am currently writing some CodedUI tests using CUITe. I have an issue defining a browser window. 

At stage 1 of the the website process you are asked for a title of you project, for this i use a guid. This current page = 

public new string sWindowTitle = "PleaseReview™";

when i get to 5 page of project creation the unique title added at stage 1 is incorparted into the browser title. e.g. = public new string sWindowTitle = "[project title] PleaseReview™"; My question; in order to interact with this page i need a broswer title, this is causing me an issue as i have had to used a guid. How do i get the browser title and then point that at the relevent page in the object repository in order to interact with the page.

Thanks,

Ashley  

Coordinator
Aug 30, 2012 at 2:13 AM
Edited Aug 30, 2012 at 2:13 AM

Hi Ashley,

Support for this feature has been implemented in changeset #19710.

There are some unit tests that illustrate the functionality in Sample_CUITeTestProject\BrowserWindowTests.cs, specifically Launch_GetWindowTitle_Succeeds, GetBrowserWindow_WithDynamicWindowTitle_CanGetNewWindowTitle, and GetBrowserWindow_WithDynamicWindowTitle_CanInteractWithWindow.

To get the current window title of a browser, get the value of the Title property of the CUITe_BrowserWindow.

The CUITe_DynamicBrowserWindow class can also be used to support interacting with web pages that contain dynamic window titles.

The class can be inherited and a title passed in GetBrowserWindow<T>() as follows:

 

ReviewPage reviewPage = CUITe_DynamicBrowserWindow.GetBrowserWindow<ReviewPage>("[project title] PleaseReview™");



Thank you.

Coordinator
Aug 30, 2012 at 5:37 AM

You can also call the SetWindowTitle(string title) method to set the window title of the browser used when searching for controls.

Aug 30, 2012 at 9:44 AM

That's great, thank you for your help.

Hanging my head, can you advise how i get the chances made in #19710, do i have to download from somewhere. 

Sorry this is all quite new to me.

Thanks again,

Ashley

Aug 30, 2012 at 11:21 AM

Sorted, thanks

Ashley