print test case status and failure message in teardown
-
- Posts: 10
- Joined: Tue Dec 06, 2011 9:11 am
print test case status and failure message in teardown
Hello,
How can I print the test case status and failure message/exception (if test failed) in the teardown script ?
Looking to just do something like
console.writeline("status:" + test.status)
if(test.status.failed)
console.write ("message: " + test.failuremessage)
Thanks
How can I print the test case status and failure message/exception (if test failed) in the teardown script ?
Looking to just do something like
console.writeline("status:" + test.status)
if(test.status.failed)
console.write ("message: " + test.failuremessage)
Thanks
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: print test case status and failure message in teardown
Hi,
At the moment there is no way how you can get the status in the teardown of the test case, but this is a known issue and we will add this functionality in one of our future releases.
Regards,
Markus
Ranorex Support Team
At the moment there is no way how you can get the status in the teardown of the test case, but this is a known issue and we will add this functionality in one of our future releases.
Regards,
Markus
Ranorex Support Team
Re: print test case status and failure message in teardown
Hello,
Warkaround: I think you can do this with the IReportBuilder Interface and another application that display the messages.
I do something like this to know the number of testcases passes, failed or blocked on my VMs (with a simple UPD connection to tranfer data). see http://www.ranorex.com/forum/ranorex-re ... tml#p11489
I hope this help
Warkaround: I think you can do this with the IReportBuilder Interface and another application that display the messages.
I do something like this to know the number of testcases passes, failed or blocked on my VMs (with a simple UPD connection to tranfer data). see http://www.ranorex.com/forum/ranorex-re ... tml#p11489
I hope this help
SW
-
- Posts: 10
- Joined: Tue Dec 06, 2011 9:11 am
Re: print test case status and failure message in teardown
Hello Markus,
Do you have a date when this will be available. The last two releases do not have this feature (per the release notes)
http://www.ranorex.com/download/release ... html#c3788
Thanks
Do you have a date when this will be available. The last two releases do not have this feature (per the release notes)
http://www.ranorex.com/download/release ... html#c3788
Thanks
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: print test case status and failure message in teardown
Hi,
Regards,
Peter
Ranorex Team
This feature will be available with Ranorex 3.3.agiletestware wrote:Do you have a date when this will be available. The last two releases do not have this feature (per the release notes)
Regards,
Peter
Ranorex Team
-
- Posts: 10
- Joined: Tue Dec 06, 2011 9:11 am
Re: print test case status and failure message in teardown
What is the tentative release date for 3.3 ?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: print test case status and failure message in teardown
Hi,
I cannot tell you an exact date now, but it should be available end of Q1 or at the beginning of Q2.
Regards,
Peter
Ranorex Team
I cannot tell you an exact date now, but it should be available end of Q1 or at the beginning of Q2.
Regards,
Peter
Ranorex Team
-
- Posts: 10
- Joined: Tue Dec 06, 2011 9:11 am
Re: print test case status and failure message in teardown
Hello Peter,
Any update on when this will be available ?
Thanks
Ali
Any update on when this will be available ?
Thanks
Ali
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: print test case status and failure message in teardown
Hi,
please be patient, it will be available soon...
Regards,
Tobias
Ranorex Team
please be patient, it will be available soon...
Regards,
Tobias
Ranorex Team
Re: print test case status and failure message in teardown
Hi
I'm also interested in Ranorex v3.3
I'm getting more and more tests with status "to be continued when Ranorex 3.3 released because can't verify cell color" (I've already posted my question and got answer here: http://www.ranorex.com/forum/how-to-get ... t3084.html)
Take your time - don't hurry with release - we need good and bug-less tool for automation
- but let us know when Ranorex 3.3 is ready and please provide couple of examples how to use new features from it.
-re
Pavlo
I'm also interested in Ranorex v3.3

I'm getting more and more tests with status "to be continued when Ranorex 3.3 released because can't verify cell color" (I've already posted my question and got answer here: http://www.ranorex.com/forum/how-to-get ... t3084.html)
Take your time - don't hurry with release - we need good and bug-less tool for automation

-re
Pavlo
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: print test case status and failure message in teardown
Hi Pavlo,
To be honest, I think the version will be available at end of May.
Regards,
Peter
Ranorex Team
As you said we don't want to hurry, because we want to deliver a stable product for our customers. We also have a complete new Plug-In "Android Plug-In" in this version and a lot of other nice features.Pavlo wrote:on't hurry with release - we need good and bug-less tool for automation
To be honest, I think the version will be available at end of May.
Regards,
Peter
Ranorex Team
-
- Posts: 10
- Joined: Tue Dec 06, 2011 9:11 am
Re: print test case status and failure message in teardown
Hi Peter,
Do you know if this is now possible in the 3.3 release?
I did not see anything in the 3.3 release notes
Thanks
Do you know if this is now possible in the 3.3 release?
I did not see anything in the 3.3 release notes
Thanks
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: print test case status and failure message in teardown
Hi Pavlo,
I am afraid that this feature is not part of Ranorex 3.3. I have already added a feature request to our internal bug tracking system.
You can try the following code as workaround.
Please create a new UserCode Module at the beginning of the tear down area and insert this code. It will read all messages out of the activity stack and writes it into the console output.
I hope that I could help you with this workaround.
Kind regards,
Bernhard
Ranorex Support Team
I am afraid that this feature is not part of Ranorex 3.3. I have already added a feature request to our internal bug tracking system.
You can try the following code as workaround.
Please create a new UserCode Module at the beginning of the tear down area and insert this code. It will read all messages out of the activity stack and writes it into the console output.
Code: Select all
[TestModule("F6E3A1C6-ABBB-46E2-B342-27AA82B323AF", ModuleType.UserCode, 1)]
public class WriteErrorMessage : ITestModule
{
/// <summary>
/// Constructs a new instance.
/// </summary>
public WriteErrorMessage()
{
// Do not delete - a parameterless constructor is required!
}
/// <summary>
/// Performs the playback of actions in this module.
/// </summary>
/// <remarks>You should not call this method directly, instead pass the module
/// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method
/// that will in turn invoke this method.</remarks>
void ITestModule.Run()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;
var rootActivity = Ranorex.Core.Reporting.ActivityStack.Instance.RootActivity;
foreach (var activity in GetAllActivities(rootActivity))
{
var errorMessage = activity.ErrorMessage;
if (!string.IsNullOrEmpty(errorMessage))
Console.WriteLine("Error message: " + errorMessage);
}
}
IList<Activity> GetAllActivities(Activity rootActivity)
{
var activities = new List<Activity>();
foreach (var child in rootActivity.Children)
{
var activity = child as Activity;
if (activity != null)
AddActivitiesRecursive(activities, activity);
}
return activities;
}
void AddActivitiesRecursive(IList<Activity> activities, Activity parent)
{
foreach (var child in parent.Children)
{
var activity = child as Activity;
if (activity != null)
{
activities.Add(activity);
AddActivitiesRecursive(activities, activity);
}
}
}
}
Kind regards,
Bernhard
Ranorex Support Team
-
- Posts: 10
- Joined: Tue Dec 06, 2011 9:11 am
Re: print test case status and failure message in teardown
hello,
Since this feature was not delivered in 3.3, do you know if it is being done in the next release?
Just need to be able to see how to print testcase name, status, assert messages (for failing tests)
I am not really sure the example below with the testmodule prints out testcase status, failure message etc
Thanks
Since this feature was not delivered in 3.3, do you know if it is being done in the next release?
Just need to be able to see how to print testcase name, status, assert messages (for failing tests)
I am not really sure the example below with the testmodule prints out testcase status, failure message etc
Thanks
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: print test case status and failure message in teardown
Hi,
This feature was added in Ranorex 3.3.2 "The result of a test case iteration can now be evaluated within teardown modules".
The follwing forum post could also be of interest: Testcase iteration status in teardown.
You can get the status of the current test case with the following code:
Regards,
Markus
Ranorex Support Team
This feature was added in Ranorex 3.3.2 "The result of a test case iteration can now be evaluated within teardown modules".
The follwing forum post could also be of interest: Testcase iteration status in teardown.
You can get the status of the current test case with the following code:
Ranorex.Core.Testing.TestCase.Current.Status, there are also other properties of the current test case instance which can be accessed, like the name.
Regards,
Markus
Ranorex Support Team