Only first test case in test report

Class library usage, coding and language questions.
stefanb
Posts: 18
Joined: Fri Feb 01, 2013 2:30 pm

Only first test case in test report

Post by stefanb » Wed Apr 03, 2013 4:20 pm

Hi

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Only first test case in test report

Post by Support Team » Fri Apr 05, 2013 8:42 am

Hello,

Unfortunately, it's not possible to show several Test Cases in one report using CodedUI.
I recommend you to use Ranorex Studio to have several Test Cases in one report.

Please take a look at our User Guide for more information.

Regards,
Markus (T)
.
Image

stefanb
Posts: 18
Joined: Fri Feb 01, 2013 2:30 pm

Re: Only first test case in test report

Post by stefanb » Fri Apr 05, 2013 1:17 pm

Hi Markus

Is this something you will look into for Coded UI? It would really be handy and feels like a natural setup.

BR Stefan

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Only first test case in test report

Post by Support Team » Mon Apr 08, 2013 4:59 pm

Hi Stefan,

If you want that a single report should be created you could start the test suite with a specific "Test Run Configuration" in order to execute more test cases "in one run".
Do you know the blog about Coded UI Testing? There it is quite good described how you could run the test suite with a individual configuration.

Regards,
Markus
.
Image