Page 1 of 1

Code Module from library not found if put in Suite's SETUP

Posted: Wed Jan 28, 2015 6:57 pm
by krstcs
Ranorex 5.2.2
Windows 7
.NET 4.5

I have a generic library (DLL) that I keep code modules in that are being used in multiple projects. Generally this works well.

However, if you attempt to put a module from a referenced DLL in the SETUP section of the test suite it throws an exception saying the module is not found.

This same module works fine if it is placed inside a test case, the issue only happens when it is placed in the suite's SETUP area. (Note: Putting them in any TEARDOWN section works fine as well.)

For example, the following will work:

Code: Select all

Testsuite
--[SETUP]
----LocalModule1
--TestCase1
----[SETUP]
------LibModule1 ****
But the following will not work:

Code: Select all

Testsuite
--[SETUP]
----LibModule1 ****
----LocalModule1
--TestCase1

Re: Code Module from library not found if put in Suite's SETUP

Posted: Thu Jan 29, 2015 4:30 pm
by Support Team
HI krstcs,

Thank you for reporting this, but unfortunately I was not able to reproduce the mentioned behavior.

Everywhing works as expected. May I ask you to send us a small sample solution?

Thank you in advance.

Regards,
Markus (S)

Re: Code Module from library not found if put in Suite's SETUP

Posted: Mon Feb 02, 2015 5:38 pm
by krstcs
OK Markus, I found the issue.

I have multiple projects in my main test solution with the first one being the core project. All other projects are including it as a reference. The core has the DLL as a direct reference, but the others do not. They are all indirectly referencing the DLL through the CORE.

This has always worked fine as long as I keep the DLL modules in test cases because the core project (and the DLL, indirectly) was initialized by then, but when I added a couple of the DLL's modules directly to the Suite's SETUP area, before the DLL is used anywhere else, it started doing this.

If I add the DLL as a direct reference this works, but if it is an indirect reference it doesn't.

I still think that it is a bug. If the indirect reference works in the test cases (which it does) then it should work anywhere, even in the suite's SETUP area, even if this is the first use of the indirect reference.

So, to reproduce this, I've created a suite that demonstrates the issue. The CORE project will run fine since it has the direct reference to the DLL, but the FAILURE project will throw the exception because it has the indirect reference before the DLL is initialized. If you move the modules into the test case it will work though (SUCCESS project), but only if I reference the DLL in one of the modules from the CORE project before the user code.

All of these should work.

Attached is a ZIP that contains both the DLL solution and the test solution (with 3 projects, CORE, FAILURE, SUCCESS).

Re: Code Module from library not found if put in Suite's SETUP

Posted: Tue Feb 03, 2015 2:49 pm
by Support Team
Hi krstcs,

Thank you for the detailed explanation and the sample solution. I’ll forward your solution to our development team and one of my colleagues will analyze the issue in more detail.

Regards,
Markus (S)