Page 1 of 1

No Ranorex report generated when using Code module as DLL

Posted: Mon Oct 20, 2014 11:11 am
by zivshapirawork
hi

I am using Ranorex as a DLL reference in a .NET Visual Studio solution.
  • When I am activating a recording module (from the solution), then a Ranorex report is generated for Report.log(...) calls in the dll

    When I am activating a code module, then a Ranorex report is not generated for Report.log(...) calls in the dll
I expected a report to be generated for Code modules as well. Any ideas why it is not generated? :?:

Ranorex version 5.1.1

Re: No Ranorex report generated when using Code module as DLL

Posted: Wed Oct 22, 2014 9:03 am
by Support Team
Hello zivshapirawork,

May I ask you to answer following questions?
  • • Do you reference your Ranorex solution as a DLL
    or do you use the Ranorex DLLs (Ranorex.Core, etc.) within your Visual Studio solution?

    • How do you call the Recording/Code module within your Visual Studio solution?
    • Do you get any warnings/errors?
Thanks,
Robert

Re: No Ranorex report generated when using Code module as DLL

Posted: Thu Oct 23, 2014 9:51 am
by zivshapirawork
Hi Robert

1. In my solution (not ranorex), I reference a DLL that is build of a Ranorex solution as a class library (the Ranorex solution is a set of modules, either recording modules or code modules). I am not using directly Ranorex DLLs (such as Core etc.).

2. In my solution, I instantiate a C# class (from my ranorex reference) that for each Ranorex module - has a method that calls the START of the module. For example the C# class would have a StartModuleSOMEMODULE() method, if I need to activate the SOMEMODULE() Ranorex recording/Code module in my solution. On the Ranorex side this is the code:

Code: Select all

        
public void StartModuleSOMEMODULE()
        {        
        	SOMEMODULE.Start();
        }
If I call recording modules there is a Ranroex report generated when I run my solution. For Code modules, there is no report generated, even though there are report.log(...) calls. I think the Ranorex report needs to be generated even if I only call Code modules as described above.


Ziv Shapira

Re: No Ranorex report generated when using Code module as DLL

Posted: Fri Oct 24, 2014 1:58 pm
by Support Team
Hello Ziv,

Thank you for the clarification.

Please call following line of code in order to setup the report within a Visual Studio solution:
Ranorex.Core.Reporting.TestReport.Setup(ReportLevel.Info, "%S_%Y%M%D_%T.rxlog", true);
In order to execute UserCodeModules, please proceed as shown below:
var UserCode = new MyRanorexSolution.UserCodeModule();
TestModuleRunner.Run(UserCode);
Hopefully this resolves your issue. Please report back whether this approach works for you or if you are still facing issues.

Regards,
Robert

Re: No Ranorex report generated when using Code module as DLL

Posted: Sun Oct 26, 2014 6:53 am
by zivshapirawork
I upgraded to Ranorex 5.2.0 before attempting your solution, but that already caused the reports to be generated without any change, even when only invoking Code modules (and not recording modules).

Thank you
:D