TestSuite fails but activitystack status show success

Class library usage, coding and language questions.
karltinsly
Posts: 43
Joined: Tue Jun 07, 2016 9:59 pm

TestSuite fails but activitystack status show success

Post by karltinsly » Tue Jul 16, 2019 5:19 pm

I have a bit of usercode in my teardown that is reporting in a text file log the results of Ranorex.Core.Reporting.ActivityStack.Current.Status.ToString(). Regardless of whether the test suite has failed or not (as reported in the .rxlog), the status returns Success.

I have one test case with several smart folders that are set to stop on fail. If one of the folders fails, the ranorex report shows a big red pie, but my captured activitystack status still say Success.

Am I not understanding what the status should be returning?

Thanks!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: TestSuite fails but activitystack status show success

Post by odklizec » Tue Jul 16, 2019 5:49 pm

Hi,

At first, what Ranorex version do you use? Most recent version is 9.1.1. If you are using something older, please update it. At next, where exactly is placed the code you are using? Make sure it’s called near the end of test, ideally, as a last action before ‘return’ in program.cs.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

karltinsly
Posts: 43
Joined: Tue Jun 07, 2016 9:59 pm

Re: TestSuite fails but activitystack status show success

Post by karltinsly » Tue Jul 16, 2019 8:34 pm

Thanks for your reply. I'm on version 9.0.1. We are not ready to upgrade yet. Hopefully this is not an issue that can only be resolved by upgrading.

The usercode that is capturing the test suite status is in the teardown - the very last module before sending an email through the automation helper.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: TestSuite fails but activitystack status show success

Post by odklizec » Wed Jul 17, 2019 7:59 am

Hi,

I don't know why, but TestSuite TearDown doesn't seems to be a correct place for collecting Test Suite status. I believe it's because the Test Suite is, technically, not finished yet at a time of calling the 'status' code? So if you want to collect the TS status, you must do it in Program.cs, ideally, right after Run action. Which means, you will also have to call the sendmail from there? ;)
TSStatus.png
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

karltinsly
Posts: 43
Joined: Tue Jun 07, 2016 9:59 pm

Re: TestSuite fails but activitystack status show success

Post by karltinsly » Wed Jul 17, 2019 1:54 pm

Okay, thank you.