Parameters of module called from another module in report

Ask general questions here.
kOoO
Posts: 21
Joined: Wed Oct 17, 2018 11:15 am
Location: Zlin, CR

Parameters of module called from another module in report

Post by kOoO » Thu Jul 09, 2020 11:57 am

Hi,

when I call a module (module1) from another module (module2) (by TestModuleRunner.Run(module1) method), I would like to see in the report parameters of module1. I have tried to wrap the module1 call with "TestReport.(Begin/End)TestModule()", which creates the module sections in report, which is nice (even nicer would be if they could be nested under the caller module), but parameters of the module1 are still not logged in report like for modules that are called "normally" (from rx test suite).

Is there any way how to tell Ranorex to automatically log these parameters at the start of each test module called dynamically? Without needing to log them manually from inside of the each module.

PS: modules are run conditionally, so I can't use group modules.
Attachments
Screenshot_9.jpg
Screenshot_9.jpg (69.83 KiB) Viewed 84 times

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

Re: Parameters of module called from another module in report

Post by odklizec » Thu Jul 09, 2020 12:10 pm

Hi,

I'm afraid, that there is no out-of-the -box solution for this problem? Using TestModuleRunner.Run is definitely not recommended way of running test modules and therefore, report logger is most probably not optimized for this action. There maybe a solution for this, but I guess it would require some extra coding/editing of report template? Your best hope is to contact directly Ranorex support about this (via support form)?
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

kOoO
Posts: 21
Joined: Wed Oct 17, 2018 11:15 am
Location: Zlin, CR

Re: Parameters of module called from another module in report

Post by kOoO » Thu Jul 09, 2020 4:03 pm

Sorry to hear that. I thought that if the method is documented in API reference https://www.ranorex.com/Documentation/R ... _Run_1.htm , it should be fully supported. For me it's super useful in lots of cases to avoid copy-paste, save time and to keep test suite clean, since test cases can't be reused.

Maybe it would work by using ActivityStack.BeginActivity event, but it does not seem to be documented at all. I have tried using it, but didn't find way to get current module instance. If I had that, I could easily log the module parameters using reflection. Unfortunately the "TestModuleLeaf.Current" holds the instance of the parent module (caller), not the actual current one that got called dynamically :(

User avatar
N612
Posts: 135
Joined: Mon Jul 11, 2016 4:01 pm

Re: Parameters of module called from another module in report

Post by N612 » Thu Jul 09, 2020 4:46 pm

kOoO wrote:
Thu Jul 09, 2020 4:03 pm
since test cases can't be reused.
While test cases cannot be reused, have you looked into test module groups (linked below)? They are a single container for multiple modules, and in a sense, can be used as a "test case" that can be reused with a single point of maintenance.

https://www.ranorex.com/help/latest/ran ... -elements/ (scroll down to "Module groups" about halfway down).

kOoO
Posts: 21
Joined: Wed Oct 17, 2018 11:15 am
Location: Zlin, CR

Re: Parameters of module called from another module in report

Post by kOoO » Thu Jul 09, 2020 5:02 pm

As I said earlier, the modules are run conditionally and I can't put conditions inside group module. Next bad thing is group modules cant be nested. It either has to be coded or put inside the testsuite where conditions can be made, but cant be reused. I dont know other way, so the code module is only acceptable solution f9r me.