How to update Test Case Description via code

Ask general questions here.
syartsev
Posts: 7
Joined: Thu Aug 10, 2017 4:54 pm

How to update Test Case Description via code

Post by syartsev » Mon Sep 17, 2018 7:12 pm

Hello,
I'm trying to update a description of a test case.

Was able to get it, but have difficulties to set to something different.

Code: Select all

var TC = Ranorex.Core.Testing.TestSuite.CurrentTestContainer as TestSuiteEntryContainer;
TC.Comment = "hi";
After test run, description in *.rxtst UI has previous value.
Attachments
description.png
description.png (8.66 KiB) Viewed 81 times

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

Re: How to update Test Case Description via code

Post by odklizec » Mon Sep 17, 2018 7:42 pm

Hi,

I don’t think there is a public API to change the comments in rxtst file? What you have done is changing the comment during runtime, but it does not modify the rxtst file. The easiest way to edit comments in test suite is to edit the rxtst file in an external text editor (notepad++ or similar). But don’t forget to make a backup copy before editing it ;)
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

syartsev
Posts: 7
Joined: Thu Aug 10, 2017 4:54 pm

Re: How to update Test Case Description via code

Post by syartsev » Mon Sep 17, 2018 7:59 pm

Thanks.
Is there any other approach to assign PASS/FAILED to a test case, that could be visible from Ranorex UI, especially in *.rxtst file?

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

Re: How to update Test Case Description via code

Post by odklizec » Mon Sep 17, 2018 8:18 pm

As far as I know, no. The only way, to achieve what you want, is most probably manual editing of test case description.
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

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

Re: How to update Test Case Description via code

Post by Support Team » Mon Sep 17, 2018 8:18 pm

Hi syartsev,

Unfortunately, there is no built-in way to report a test case status in the test suite file at this time. The results of a test are all contained within the generated Ranorex Report file. I recommend creating a new feature request on our User Voice platform as I can see this being a useful feature. It means more when the request comes from you directly than from me.

Kind Regards,
Ned
.
Image