Where is the text contained in the Ranorex UI "description" filed located and is it accessible through the API?
I've searched and found a solution that involved using the deprecated TestCase class, but I can't seem to find a suitable alternative.
Likewise I'd like to get the testcase execution duration value, but I haven't started the hunt for that one yet.
Get Test Case Description
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Get Test Case Description
Doug Vaughan
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: Get Test Case Description
I think I found what I needed in the TestCaseActivity class. I'm not sure this is the best approach, so if anyone has other suggestions, please let me know.
Code: Select all
ActivityStack.Instance.VisitAll(Function(a)
Dim myTestCase As TestCaseActivity = TryCast(a, TestCaseActivity)
If (myTestCase IsNot Nothing) Then
MsgBox(myTestCase.TestCaseName)
MsgBox(myTestCase.DetailMessage)
MsgBox(myTestCase.TotalDuration)
End If
Return True
End Function)
Doug Vaughan
Re: Get Test Case Description
Hi,
The 'obsolete' code you found does exactly what you want. You just have to adapt it for Ranorex 6.0. Luckily, the fix is pretty easy. Just replace TestCase with TestCaseNode and you are done
In case you want also module description, use this code:
As for TC duration, check this post:
http://www.ranorex.com/forum/duration-o ... tml#p15772
The 'obsolete' code you found does exactly what you want. You just have to adapt it for Ranorex 6.0. Luckily, the fix is pretty easy. Just replace TestCase with TestCaseNode and you are done
Code: Select all
var tcDescription = TestCaseNode.Current as TestCaseNode;
Report.Info(tcDescription.Comment.ToString());
Code: Select all
var modDescription = TestModuleLeaf.Current as TestModuleLeaf;
Report.Info(modDescription.Comment.ToString());
http://www.ranorex.com/forum/duration-o ... tml#p15772
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
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: Get Test Case Description
The reporting requirements ask for results based at the testcase/iteration level. On one hand this is great because it significantly reduces the number of DB calls needed, but I don't have any context to put around a failure as I believe that is only available at the module level. Oh well.
I have found that getting the elapsed time is very straight forward:
As always, thanks for the insight.
I have found that getting the elapsed time is very straight forward:
Code: Select all
myTestCase.ElapsedTime.TimeSpan.TotalSeconds
Doug Vaughan