Testcase failed but in Report it was Success?

Class library usage, coding and language questions.
boby
Posts: 9
Joined: Fri Apr 11, 2014 9:35 am

Testcase failed but in Report it was Success?

Post by boby » Fri Jun 06, 2014 1:05 pm

Hi,

I have four testcases and two of them shall obviously fail:

Code: Select all

        [TestMethod]
        public void RanorexReporting1()
        {
            Assert.IsTrue(false);            
        }

        [TestMethod]
        public void RanorexReporting2()
        {
            Assert.IsTrue(true);
        }
        [TestMethod]
        public void RanorexReporting3()
        {
            Assert.IsTrue(false);
        }

        [TestMethod]
        public void RanorexReporting4()
        {
            Assert.IsTrue(true);
        }

        [TestCleanup]
        public void Cleanup()
        {
            TestReport.BeginTestCase(TestContext.FullyQualifiedTestClassName + "." + TestContext.TestName);
            TestReport.BeginTestModule(TestContext.TestName);
            Ranorex.Report.Screenshot(TestContext.FullyQualifiedTestClassName+"."+TestContext.TestName, null);

            TestReport.EndTestModule();
            TestReport.EndTestCase();
        }
However, in the report all testcases were green:
ranorexreporting.PNG
ranorexreporting.PNG (26.79 KiB) Viewed 1018 times
What's the problem?

Great thanks in advance!

Best regards,
Bo

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

Re: Testcase failed but in Report it was Success?

Post by Support Team » Tue Jun 10, 2014 3:02 pm

Hello boby,

The problem is that Ranorex or rather the reporting mechanism does not know that the “Coded UI Test” has failed. It’s pretty similar to http://www.ranorex.com/forum/coding-wit ... tml#p26142. You need to communicate between the “Coded UI”-test and Ranorex.

May I ask how your Report.Setup() looks like?

Regards,
Robert
.
Image