none
Coded UI Test can't find WinWindow on Lab Environment machine

    Question

  • I have a WPF application that shows a windows forms window. When I run a coded UI test, on one machine out of 3 the test cannot find the windows forms window. This machine just has the Visual Studio 2013 test agent on it. The two machines where it works are a development machine and another test machine that has VS 2010 on it.

    Inspect cannot find the window in MSAA mode either. When I move the mouse over the edge of the window, this is what I get. On the development machine, there is no Error in Inspect.

    Inspect - Cannot get object from point Interface not registered

    Thursday, July 28, 2016 1:27 AM

All replies

  • Hi john,

    It seems like you were doing remote test on three machines? And can't find the window on one machine?

    If so, did you get some error message in your Visual Studio on your local machine? If have, please share here.

    By the way, since it works well on another machine which has VS installed. Please also try to install a Visual Studio on that machine to check whether it works.

    If still no help. Please use Visual Studio to record the test in that machine directly and compare the test codes with your original code ui test.

    I think the problem is probably that the tests which recorded on your local machine is not compatible in that machine.

    If I misunderstood your issue. Please feel free to let me know.

    Best Regards,

    Lake Xiao

    Friday, July 29, 2016 3:04 AM
    Moderator
  • Here's the three scenarios:

    • Running the test with Visual Studio 2013 is ok 
    • Running the test using test agent on another machine is ok. Perhaps it is because it has VS 2010 installed.
    • Running the test using test agent on third machine is not ok. Perhaps because it has no Visual Studio. However I don't want to install Visual Studio as it is a test machine.

    The error message is Test method <name> threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: TechnologyName:  'MSAA'ControlType:  'Window'Name:  'Add Aircraft' ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM componen

    Monday, August 01, 2016 6:25 PM
  • Hi john,

    >>Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties.

    From the error message you offered. The search property it not correct so you can't find the windows forms window.

    Since it works well on other two machines. I suppose the code ui test you is not compatible on the test machine.

    In this case, we need you to install the Visual Studio on the agent machine to troubleshoot your issue.

    After install the Visual Studio, use code UI test builder to capture the windows forms window to check whether the search property is correct. I think you need to re-record the test in the agent machine and use this new recorded test to perform remote test.

    As far as I know, this is the only way to troubleshoot your issue. If we don't install the VS on the test machine, we don't know which is the correct search property for the windows forms window.

    Best Regards,

    Lake Xiao 

    Tuesday, August 02, 2016 1:37 AM
    Moderator
  • Ok, I can try installing visual studio next week.

    However I used process explorer to look at the inspect.exe process. I did it on the machine where everything is ok, and the machine where the test doesn't work.

    Where the test works and inspect finds the window with MSAA, inspect.exe loads the following extra dlls:

    • oleacchooks.dll Active Accessibility Event Hooks Library Microsoft Corporation C:\Windows\SysWOW64\oleacchooks.dll
    • R000000000002.clb   C:\Windows\Registration\R000000000002.clb
    • UIAutomationCore.dll.mui Microsoft UI Automation Core Microsoft Corporation C:\Windows\SysWOW64\en-US\UIAutomationCore.dll.mui

    So perhaps the problem is one of these is not installed/registered properly. As shown in my first post, Inspect.exe says Interface not registered where the test is not working.

    Thursday, August 04, 2016 12:09 AM
  • Hi john,

    I did a research about C:\Windows\SysWOW64\oleacchooks.dll, C:\Windows\Registration\R000000000002.clb and C:\Windows\SysWOW64\en-US\UIAutomationCore.dll.mui, and I found they are windows system dlls.

    I am not sure whether the problem is in this, please try to take a look at the following document about these dlls.

    http://www.solvusoft.com/en/files/missing-not-found-error/dll/windows/microsoft/windows-7-home-premium/oleacchooks-dll/

    http://www.dll-fix-center.com/fix-file-error/r000000000002.clb.html

    http://systemexplorer.net/file-database/file/uiautomationcore.dll-mui

    By the way, after install the Visual Studio on the machine. Please record the a simple code UI test on the machine. If still have the same problem.

    I think one possible is that the system environment is broken. In this case, you may need to restore the windows system.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Lake Xiao

    Thursday, August 04, 2016 1:06 AM
    Moderator
  • Thanks for the information. I compared registry and filesystem on two computers and couldn't see any obvious problems with these files and their registration, so I decided not to try these third party tools.

    There is another test computer that is set up in the same way where the Coded UI test and Inspect are working, so we have decided to use this one, and if we need to use the other in future, then we will reimage it and see if this fixes the problem.

    Thanks for your help.

    Alice Johnson

    Thursday, August 18, 2016 12:14 AM
  • Hi  Ailce,

    Thanks for your response.

    >>and if we need to use the other in future, then we will reimage it and see if this fixes the problem.

    Since the test can be ran in another test computer. I think the test should be ok. And according to the error message you offered. I think the cause is probably in your System environment.

    So as you said, please use another test computer first. If you want to use the other machines. Reimage it, I think the problem will be fixed.

    Best Regards,

    Lake Xiao

    Thursday, August 18, 2016 2:11 AM
    Moderator