Recorded UI Test - COMException when trying to find a button in IE's popup window - by romario3

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 597945 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 9/15/2010 1:32:20 AM
Access Restriction Public


I have recorded a coded UI test for web application running in Internet Explorer 8. During test popup window is opened twice, test fails on the second popup with:

Error Message:
Test method TestProject1.CodedUITest1.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
TechnologyName:  'Web'
ControlType:  'Document'
TagName:  'BODY'
Id:  ''
RedirectingPage:  'False'
FrameDocument:  'False'
 ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

Detailed test result is attached.

I have also created simple test project - it contains web application and UI test, run web application in IE and then run UI test, it should fail.
Sign in to post a comment.
Posted by Microsoft on 11/11/2010 at 5:07 AM

When UI Test framework searches for the second popup window, it is failing because it is trying to use a cached reference. The workaround is to perform a find on the Window.
This has to be done before clicking on the Close button second time.

NOTE: Please do not change UIMap.Designer.cs. You need to copy the code to UIMap.cs, rename the method and make the changes described above.

This is a bug which will be fixed in the next release of Visual Studio.

Mathew Aniyan
Program Manager - Visual Studio ALM.
Posted by Microsoft on 9/15/2010 at 1:56 AM
Thanks for your feedback. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.