No Ranorex report generated when using Code module as DLL

Ranorex Studio, Spy, Recorder, and Driver.
zivshapirawork
Posts: 65
Joined: Wed Sep 24, 2014 7:47 am
Location: Israel

No Ranorex report generated when using Code module as DLL

Post by zivshapirawork » Mon Oct 20, 2014 11:11 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Wed Oct 22, 2014 9:03 am

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

zivshapirawork
Posts: 65
Joined: Wed Sep 24, 2014 7:47 am
Location: Israel

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

Post by zivshapirawork » Thu Oct 23, 2014 9:51 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Fri Oct 24, 2014 1:58 pm

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

zivshapirawork
Posts: 65
Joined: Wed Sep 24, 2014 7:47 am
Location: Israel

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

Post by zivshapirawork » Sun Oct 26, 2014 6:53 am

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