When I try to run a simple coded UI test that I have written it is failing when I try to run the test. It fails on the first Mouse.Click statement (line 12 below).
In english the steps are as follows:
- Launch a new Internet Explorer Window (I find it odd that it's listed as "Click 'Chrome Legacy Window client').
- Go to the Contact Page (localhost:6983/Contact).
- Type "ardvark" into a text box and click the submit button.
- When the button is click copy "ardvark" to a label.
At this point I'm just expecting the test method to replay those steps.
Here is the generated code:
public void RecordedMethod1()
{
#region Variable Declarations
WinClient uIChromeLegacyWindowClient = this.UIVisualstudio2015CodeWindow.UIChromeLegacyWindowWindow.UIChromeLegacyWindowClient;
HtmlCustom uIBgexitCustom = this.UIMSNCanadaHotmailOutlWindow.UIMSNCanadaHotmailOutlDocument.UIADFrame.UIAolAdvertisementDocument.UIVarinDapIFtrueinFIFtPane.UIItemFrame.UIHttpnym1ibadnxscomifDocument.UIItemFrame.UIHttpanimpbidaceadverDocument.UIItem200_141_express_Frame.UIHttps02mdnnet2467206Document.UIBgexitCustom;
BrowserWindow uIMSNCanadaHotmailOutlWindow = this.UIMSNCanadaHotmailOutlWindow;
HtmlEdit uIText1Edit = this.UIMSNCanadaHotmailOutlWindow.UIContactMyASPNETAppliDocument.UIText1Edit;
HtmlInputButton uIClickMeButton = this.UIMSNCanadaHotmailOutlWindow.UIContactMyASPNETAppliDocument.UIClickMeButton;
#endregion
// Click 'Chrome Legacy Window' client
Mouse.Click(uIChromeLegacyWindowClient, new Point(565, 497));
// Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
Playback.PlaybackSettings.ContinueOnError = true;
// Mouse hover 'bg-exit' custom control at (1, 1)
Mouse.Hover(uIBgexitCustom, new Point(1, 1));
// Reset flag to ensure that play back stops if there is an error.
Playback.PlaybackSettings.ContinueOnError = false;
// Go to web page 'http://localhost:6983/Contact'
uIMSNCanadaHotmailOutlWindow.NavigateToUrl(new System.Uri(this.RecordedMethod1Params.UIMSNCanadaHotmailOutlWindowUrl));
// Type 'ardvark' in 'text1' text box
uIText1Edit.Text = this.RecordedMethod1Params.UIText1EditText;
// Click 'Click Me' button
Mouse.Click(uIClickMeButton, new Point(43, 17));
}
The following is the error I'm getting: The following is the error I'm getting: {"The playback failed to find the control with the given search properties. Additional Details: \r\nTechnologyName: 'MSAA'\r\nControlType: 'Client'\r\nName: 'Chrome Legacy Window'\r\n"}
Point()argument toMouse.Click(). Please read blogs.msdn.microsoft.com/mathew_aniyan/2012/03/16/… . However the size of the values (ie565, 497) plus the control nameuIChromeLegacyWindowClientsuggests that there is a big custom control, or perhaps an image or a canvas. - AdrianHHH