Sasirekha Samiyappan
Sasirekha Samiyappan

Reputation: 49

Coded UI Test Framework

I am using Visual Studio 2010 Ultimate C# for my testing automation. In that I have recorder a Registration module using Coded UI Test Framework.When i click on Registration button another window opens but with not maximized so when i fill the fields i need to scroll down. When recording Scroll are not recorded. So just wanted to know how to scroll down and when a new window opens how to click on Maximized.

Upvotes: 0

Views: 3835

Answers (3)

Ahetejazahmad Khan
Ahetejazahmad Khan

Reputation: 1

Once the new window pop's up find the control of the window using 'WinWindow' Class. Once u get the window for ex.

WinWindow objWindow = new WinWindow();
objWindow.searchproperty.add(WinWindow.propertyname.FriendlyName, " Pop name");
objWindow.maximized = true;

And for the control which in not clickable, find in which panel it is coming... once that is done use the panel object to search the control once you get the control write the below code.

objControl.ensureclickable();

Note: Panel will be searched using winwindow object and control using panel or anyother control where it comes.

Upvotes: 0

Vineet Kumar
Vineet Kumar

Reputation: 11

You can maximize the window using the Maximize property of the window. So before filling in the field you can maximize the window which contains the field. For example if you want to maximize the Notepad window after launching then you can do something like following

this.UIMap.UIUntitledNotepadWindow.Maximized = true;

In the above code the UIUntitledNotepadWindow is the top level window of the Notepad.

Upvotes: 1

AdrianHHH
AdrianHHH

Reputation: 14037

The method public void EnsureClickable() is described as "Scrolls the user interface to make sure that the control is clickable."

See http://msdn.microsoft.com/en-us/library/dd434011.aspx

Do not understand the part of he question about "another window opens but with not maximized ... when a new window opens how to click on Maximized". What have you tried, what happened and what do you want to happen? I recommend using the Coded UI record and generate tool, record the opening of the window and maximising it. Then examine the generated code to see how it works.

Upvotes: 0

Related Questions