How to get the value of module name.

Ask general questions here.
Posts: 1
Joined: Thu Jan 31, 2019 3:12 am

How to get the value of module name.

Post by niennte777 » Thu Jan 31, 2019 7:14 am


Sorry,I"m not good at English.
Based on the module executed just before,
I would like to separate processing with "TEARDOWN".


ModuleA Error

Variaale X = ModuleA

[TEARDOWN ] user code
If X = ModuleA
Action A
Else If X= ModuleB
Action B
Action C
End If

Could you tell with reference to "Example"?

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

Re: How to get the value of module name.

Post by odklizec » Mon Feb 04, 2019 9:18 am


You can use this code, to get the module name:

Code: Select all

using Ranorex.Core.Reporting;
var curModuleName = TestReport.CurrentTestModuleActivity.TestModuleName;
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