0

Microsoft Coded UI Test (CUIT). Can I create an independent (external) Visual Studio 2012 Premium or Ultimate solution in C# to record on my application UI without the application's source code? This solution can reference the application's assemblies. The CUIT API does not seem to help. It is not desirable to use Microsoft guidelines in doing CUIT, as it creates and inserts a test project into the application's solution. The development team does not want this test project, created by the QA team, to be part of their source code to check into their source control.

Darko Kenda
  • 4,781
  • 1
  • 28
  • 31
  • 1
    In this case, the developers are clearly idiots. It's not _their_ source control. It's _the_ source control. It's not a _QA_ project, it's a project that's necessary to the success of your application. And, BTW, the test projects should clearly branch and be labeled the same as the code that they're testing. – John Saunders May 01 '13 at 04:28
  • If you don't want QA to find your bugs, then don't check your bugs into source control. – John Saunders May 01 '13 at 04:29
  • See my question http://stackoverflow.com/questions/17329808/testing-an-wpf-app-with-codedui-tests-should-the-coded-ui-test-project-share-a for some discussion on this topic. – Pete Stensønes Jul 16 '13 at 12:41

1 Answers1

1

Coded UI testing with Visual Studio is about testing the user interface of an application. Coded UI does not care how the application was constructed (but see Note below). Coded UI test projects do not need to be in the same solution as the application. Coded UI can be used to test websites and web applications (via a web browser) where there is no Visual Studio solution available for the application. Coded UI can also be used as an automation tool, to automate routine operations that use several programs and websites to perform some action. For such automation there would be no single solution file that should have the Coded UI project.

My understanding of Microsoft's Coded UI guidelines is that sometimes it is good to have application and test in the same solution, just to keep them together so as to encourage testers and developers to use the test and keep them up to date. But there is nothing to force such togetherness.

I do not understand the impact of this sentence in the original question: "This solution can reference the application's assemblies."

Note: Coded UI needs the application under test to expose some of its user interface properties via the MSAA or UIA mechanisms. This is done for you with many types of software. See the "Platform Support" section of the "Content Index for Coded UI Test" at http://blogs.msdn.com/b/mathew_aniyan/archive/2010/02/11/content-index-for-coded-ui-test.aspx .

Added 2013-05-02: The clarification, within the comment, about wanting to link a Coded UI test to the DLLs of an application suggests there may be some confusion between what Coded UI tests are for and what unit tests are for.

Coded UI accesses the user interface of an application much like a screen reader for the visually impaired would. It also moves the mouse pointer, clicks buttons or links and enters text much like the software for people who cannot use a normal keyboard or mouse. Coded UI does not access the code directly so it does not need to reference any DLLs of the application. Before testing your application, I suggest you experiment with writing Coded UI tests to drive the Windows Calculator or to fill in forms on web pages. There are many videos and tutorials on the internet that demonstrate how to use Coded UI. Once you have some understanding of what Coded UI does and how to use it, you should be in a much better position to test your application.

AdrianHHH
  • 13,492
  • 16
  • 50
  • 87
  • Thank you so much AdrianHHH. Could you point me to a C# sample whose Coded UI test project is not in the same solution as the app? Hopefully the sample is a Windows Form app as I do CUIT on a WinForm app at this moment. I am very interested in it as it is exactly what I’ve been looking for. About "This solution can reference the application's assemblies" – what I meant was that my Windows Forms application had quite a number of dlls, so a C# Coded UI test project which was not in the same solution as the application would need to “Add References” to these dlls. Thanks again. – user2337812 May 01 '13 at 22:47
  • @user2337812 have responded in my answer. – AdrianHHH May 02 '13 at 09:19
  • (user2337812) Thank you so much, AdrianHHH, for your time and help. It is greatly appreciated. – user2337812 May 02 '13 at 16:53