Output test result (pass/fail) and a number to text file

Ranorex Spy, Recorder, and Studio.
cdmartinus
Posts: 8
Joined: Wed Jul 03, 2013 11:21 am

Output test result (pass/fail) and a number to text file

Post by cdmartinus » Fri Jul 05, 2013 10:23 am

Hi,

I am trying to get Ranorex to output the result of a test (pass or fail) along with a variable that will be a number (e.g. 49) to a simple text file, each on a separate line.

I think Ranorex is a great tool but I'm quite new to it so any help would be appreciated.

Thanks!!

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

Re: Output test result (pass/fail) and a number to text file

Post by Support Team » Mon Jul 08, 2013 3:59 pm

Hello,

I am not exactly sure what you want to do, but if you want to get the status of a test case you can use the following code snippet.
Ranorex.Core.Testing.TestCase.Current.Status
In order to write your variable into a text file I would recommend to use the "System.IO" namespace of the .NET Framework. Please take a look at the link below.
http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx

Regards,
Bernhard
.
Image