I have the following code:
using Microsoft.VisualStudio.TestTools.UITesting; using Microsoft.VisualStudio.TestTools.UnitTesting; using Ranorex; using Ranorex.Core.Reporting; namespace Test { [CodedUITest] public class Test { [ClassInitialize] public static void InitTestSuite(TestContext testContext) { TestReport.Setup(ReportLevel.Debug, @"C:\temp\MyReport.rxlog", true); TestReport.EnableTracingScreenshots = true; Ranorex.Validate.EnableReport = true; TestReport.BeginTestSuite("My TestSuit"); } [TestInitialize] public void TestInit() { } [TestMethod] public void TestCase1() { TestReport.BeginTestCase("TestCase1"); TestReport.BeginTestModule("My TestModule"); Ranorex.Validate.IsTrue(true); } [TestMethod] public void TestCase2() { TestReport.BeginTestCase("TestCase1"); TestReport.BeginTestModule("My TestModule"); Ranorex.Validate.IsTrue(true); } [TestCleanup] public void TestCleanUp() { TestReport.EndTestModule(); TestReport.EndTestCase(); } } }When I run "all tests" in VS studio I would expect the two test cases to be listed under each other under test suit in the report. However only the first test case is listed. When I debug the test I realize that the reference to the test suit is lost between the two test methods. This seems a bit weird, is this not the way to do it?
I use a Ranorex .Net Runtime Version 4.0.30319.18034 trial.
I have Windows 7 Proffesional with ServicePack 1 and .Net 4.5
BR Stefan