CodedUI Test: How to run from Web Portal (MS Test Manager's replacement) - coded-ui-tests

Using the Test hub in the Web Portal why is the "Associated Automation" tab completely empty, greyed out and prevented from being used?
What do I need to do to enable all this and run a coded ui test? I have hand coded, Coded UI tests that are build and in dlls but need to run the tests in those dlls in my test suite.
For background, I can run the tests in the dlls using a batch file and have done so successfully but struggling to get started running them from my test plan! My Microsoft "Test Manager" has the same problem, all greyed out but as Test Manager is being deprecated I am less concerned about that.
EDIT:
Another way of viewing this problem is to ask why does the Automation Status not show the option "Automated"? See picture below ...

It is not possible per MSDN documentation.
In the visual studio development environment, try right clicking on a test in test explorer, clicking something such as "Associate to Test Case", then entering in the test case number and see if that works. I believe it is greyed out because there is no valid input options through the web right now.

Related

How to close coded ui test builder that is open

When I right click the method in the project that I created, and then select "Generate Code for Coded UI Test -> Use Coded UI Test Builder", I get the following error message " To edit or add another coded UI test, you must first close the Coded UI Test Builder that is open"
Now, I am not sure where do I have to go and close the already open Coded UI Test Builder?
Anyone?
Thanks
Running multiple CodedUI test on same active desktop is not supported.
Then close that one which is already on:
Your problem is that there is another instance of the test builder open, or at least visual studio sees that as the case (it is not supported to have more than one open at a time). Verify that there is nothing open either in task manager, or by restarting.

When double clicking on a test in MS Test's test explorer, where does Visual Studio 2015 look for the test code?

I'm in process of debugging some unit tests that worked in VS2013 and broke in VS2015. There are a number of threads I'm trying to pull debugging this when I came across an odd issue: When I double click on a test in the Test Explorer, VS2015 has trouble finding the test code. The error message that appears briefly is:
"Cannot open the following file: MyTestClass.cpp" (MyTestClass is a made up name -- but you get the drift).
This happens for passing and non-passing tests. The project that houses the test code is a VS2012 (v110) project. My question is, where is VS2015 looking for the test code when I double click on the test in Test Explorer? It seems like this could be a symptom of why these tests are failing and I'm unsure what VS2015 is doing here.
Some additional information: The test class in question (one example of a class that VS2015 is having trouble finding) resides in the same folder as the .vcxproj file. The output directory for the test project is $(SolutionDir)$(Platform)\$(Configuration)\ and the intermediate directory is $(Platform)\$(Configuration)\. I can open the test class .cpp from the solution explorer and view the code. If I right click on a test from the .cpp file directly and click 'Run Test', the tests output claims "No tests found to run". I can run the test by right clicking on it in the test explorer. These are CppUnit tests. This definitely smells like some sort of path issue, but everything seems to be in place, which brings me here. Also, these tests still pass and work in VS2013's IDE without any code or compiler changes.

MTM with (automated) CodedUITest test-cases developed in VS2013 issues

I have created a number of (standalone) automated test-cases captured using CodedUITest in Visual Studio 2013, to test webpages.
They work fine within Visual Studio, individually; and when several of them are put into a single project as a solution, to create a kind of playlist.
However, I'm trying to use Microsoft Test Manager as a 'front-end' - in order to be able to select which tests, create play-lists, decide how many times a specific test-case should be run etc, with the results stored.
TFS is being used to both store my (individual) test-cases, and, where I'd like to deposit the resultant output of pass/fail etc.
Trouble is, even though the test-automation part functions very well within Visual Studio, getting Microsoft Test Manager to function with what I have, and its associated environment is proving a COMPLETE NIGHTMARE.
My system is simple; I have a virtual machine setup with the testing environment which allows (within VS) for me to run these automated tests.
Why is this proving so difficult to work with MTM? It should be easy - I should simply be having to point MTM at the folder my test-cases are stored, and use its GUI to tell it what and how many tests I want to run.
Anyone else have a similar problem, or a similar setup?
All MS do is point me to (countless) pages which I've already read - for which the whole lot seems to be much deeper than it needs to be.
You cant just point MTM at a folder and tell it to run the tests as it would have no idea where to put the data. The results of each codedui running are associated with a corresponding test case in mtm.
You also need to have an automated build create the output (your assemblies) for you. Idealy everything goes together with your application. As your application changes, so will your tests.
You should add your CodedUI projects to the same solution that is used to build the application that you are testing. Then when the automated build for that application kicks off your code is picked up to. Both things, test and application, end up in a drop location. It is that drop location that MTM will use to find your test assemblies.
If, while you have the main solution open, you open/create a Test Case you can go to the automation tab in Visual Studio and associate one of your CodedUI tests with that Test Case. The test case will then show up as Automated in MTM.
Now that we have the versioned bits and know where to find them MTM needs somewhere to run them. If you open MTM and switch to the Lab center you can create a Standard environment to run your tests. This will automatically go install the agents required so you wikk need admin on those boxes.
Now that we have both versioned tests and an environment you can find the Test Case in MTM and see that it is "automated". If you right-click on it and say run you will get a box requesting an environment, and which version of the bits to go run. It will then go off and run those tests against that environment and feed the result back into the Test Case.
Does that help?
You'll need to setup Test controller and Test agent and associate you build with a Test Plan in MTM.In Test Lab you need to associate Test Agent to the Test Controller.
Once done you'll need to allow File & Printer sharing exception
And then you will have to add Test Controllers and Agents to Appropriate Groups.
Control Panel->All Control Panel Items->Administrative Tools->Computer
Management

nUnit and Azure - How to start Dev Fabric from nUnit

I'm trying to create a worker process for Azure and I'd like to test it via nUnit. I need to write a process which connect to storage and uploads data to it. The problem is I can't find any references to how you actually set up the testing framework to start dev fabric etc.
I've created the Work Processor role and then created a testing project, wired up nunit to start and for the project to pick up the test project dll. This all works fine with nUnit opening, I'm able to see the test dll and run the test.
My issue is "How do I get the dev fabric to start up when running the project through nUnit?" I'm presuming that I need to put something into the setup routine within the test project but I can't see what I should put in.
If anyone has any tips, experience etc., links to how to etc. I'd be very grateful. I'm sure that I can't be the first person who want to put Azure projects under test.
Haven't done this myself, but the DevFabric (compute and store) has a command-line interface.
You would just invoke the commdn from your test stand-up routine and it should be good to go.
CSrun.exe is the command, please see MSDN for usage reference:
http://msdn.microsoft.com/en-us/library/gg433001.aspx

Coded UI Tests automation

I want to automate the process of running coded UI tests.
Do i need to have user logged in to the system?
Or is it possible to run it using XYNT service?
We are able to run our coded ui tests in an automated fashion using windows scheduler and the command line MSTest.exe. Take a look at the following MSDN article on how to accomplish this:
http://msdn.microsoft.com/en-us/library/ms182486.aspx
I believe you can use Microsoft's Test Manager to accomplish this as well but we don't have TFS (yet) so I can't vouch for it.
As far as I know, CodedUI Tests require an active desktop session, so running them under a service account without an open desktop session may work, but not without a session.
I used the mstest to run the coded ui test and use Windows TaskScheduler to schedule the test.
You can find detail in MSTest.exe command-line documentation.
When you want to run it automatically, there are two things you should pay attention:
1. Set auto log on
2. Close the screen saver
You need to take the snapshot of your enviroment with user logged in and then you can run your test through MS Test Manager or TFS (nightly build process)
Write the test's in Visual Studio 2010/2012, this means you can manually edit the test's the code, then you should run them in Test Manager,
BTW you need TFS and Test Manager to be the same year otherwise it won't work.
I've being doing a lot of these recently if you have any questions post it online and send me a message, I'll be happy to help.

Resources