How to Get Time Duration of all completed test cases with code
How to Get Time Duration of all completed test cases with code
I am trying to write to code to get the time duration of all completed tests cases in the final teardown routine of the test suite. Is this possible and if so how do I do it? I am using C# as my language.
Re: How to Get Time Duration of all completed test cases with code
Hi,
This piece of code should help:
This piece of code should help:
Code: Select all
using Ranorex.Core.Reporting;
var tm = TestReport.CurrentTestSuiteActivity;
var testDurarion = tm.TotalDuration.ToString();
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to Get Time Duration of all completed test cases with code
Thanks for the response. I am trying to get the test duration of each individual test case at the very end of of the test run. For example I want the test case 1 duration, test case 2 duration, and etc. Is this possible?
Re: How to Get Time Duration of all completed test cases with code
Hi,
I believe that you should use CurrentTestContainerActivity instead of CurrentTestSuiteActivity.
I believe that you should use CurrentTestContainerActivity instead of CurrentTestSuiteActivity.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
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
Re: How to Get Time Duration of all completed test cases with code
Thanks. So I would have to run this code after each test case?