Running Ordered tests using MS-TEST throws error

2k views Asked by At

I started using Ordered tests recently in VS 2010. I have created a folder under my test-suite and dragged the tests (required tests in a flow) from test list editor to the ordered test list. I am able to run the ordered test from VS successfully. But when I run the ordered test using MSTest, ordered test gets error (all of its tests gets not executed). When I opened the Ordered test file in notepad, I see everything properly configured like storage path as shown below

*<?xml version="1.0" encoding="UTF-8"?>
<OrderedTest name="MyOrderedTest" storage="OrderedTests\MyOrderedTest.orderedtest" id="afadbaf6-7915-426d-932c-788fc27c7a8f" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
  <TestLinks>
    <TestLink id="c2367ab7-ab71-bdaf-d039-4d55ea87e962" name="TestOne" storage="TestSuiteName.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <TestLink id="cc156aeb-ed8e-12d6-c9ad-24fadc2ca54b" name="TestTwo" storage="TestSuiteName.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <TestLink id="caa09202-b582-e53c-cae9-7fe8b402b4a2" name="TestThree" storage="TestSuiteName.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </TestLinks>
</OrderedTest>*

Test run error When I ran a single test 'TestOne' using MSTest, it runs successfully. Is there anyother thing that I need to configure/change??

Thanks in Advance. Sham_

2

There are 2 answers

0
anisa mohammed On

Even with 2012 version this issue exists . Moving the ordered test to root folder solved the issue for me as well.

0
Elena On

Did I understand you correctly: you have stored your ordered test in a sub-folder?

If so, just move your ordered test in to the root folder (do not use a sub-folder for storing them).

I had been facing the same problem using ordered tests for test automation. When running them from Microsoft Test Manager I got the error

"Cannot find the test ‘XXX’ with storage ‘..\bin\debug\YYY.dll"

According to this message Test Agent (the component that runs the tests) is looking for them in the root folder and not in a sub-folder I've stored them in. Moving the ordered tests to the root folder of my solution solved the problem.

It seems to be a bug.

PS: You can check in the Output window why the tests were not executed.