Saturday, December 4, 2010

Error adding test case, there is no test with specified id.

Last week I was testing the Coded UI Test feature of Visual Studio 2010. But when I ran the test in an lab management virtual environment, the test returned an error. In the error log I found the following error message:

Error adding test case [xx] to test run: There is no test with specified Id {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.

I found out that the error was caused by the fact that I was running the test against a build that didn’t contain the coded UI Test associated with the Test case.  The problem was that I scheduled a new test run in the Microsoft Test manager without changing the build.

To solve the error I queued a build, verified that the build succeeded, then changed the build associated with the test plan. So be sure that your test plan is always up to date with the correct build.

4 comments:

Anonymous said...

Here is another item to check when you get this error:

http://phillipabell.wordpress.com/2011/04/07/there-is-no-test-with-specified-id/

hancus said...

You have brought up a very wonderful details , regards for the post.

Glenn Quirynen said...

Hi,

I have a simular problem.

We currently have about 150 automated codedui test cases running just fine.

When we now create new codedui test cases and associate them with new acceptance test cases, for all those test cases, the same error "error adding test case to run, no test with specified id" occurs.
The test case however runs fine in debug.

Suggestions of different other topics don't solve the problem.
- make sure the latest build is used. CHECK
- unlink and re-link the assocation. CHECK
- make sure the vsmdi file is correct. CHECK
- inspect the build assembly to see if the test is available in the dll. CHECK

I do notice one strange thing.
If I run the codedui test in visual studio in debug, the test case GUID in the output window in different from the actual GUID in the assocations or in the vsmdi file.
I also tried to update the guid on both locations, but this does not solve the problem.

So currently, all newly added test cases give the above error
Error adding test case [xx] to test run: There is no test with specified id {GUID}

We do still work on TFS2010 and use visual studio 2010/2012 in combination.

Glenn Quirynen said...

Hi,

I have found a solution.

I tried the suggestion of creating a brand new project file, a brand new basic codedui test.

So I created
- a brand new project file
- a brand new coded ui test
- a brand new acceptance test
- associated the coded ui test and the acceptance test
This is working perfectly.

I then took one of my existing project files and deleted it (without deleting the actual cs files).
I added 1 new coded ui test, so the references to the necessary assemblies where added as well to the project, and a uimap was created.
I re-added all of the existing files (.cs, .config, .csv) and have overwritten the uimap with my old one.
Rebuild everything and tried again, and IT WORKS.
This also works on a machine where both VS2010 and VS2012 are installed.

I suppose something was out of sync when we converted the project files from VS2010 to 2012 and then rolled them back to VS2010.

I compared both project files and following information was available in the NOT working project, which is not in the working project.
However manually deleting them, did not solve the problem. I really have to create a whole new project file.



4.0





Thanks,