re-use module in other test-suite/solution

Ask general questions here.
davyb
Posts: 6
Joined: Wed Sep 04, 2013 12:58 pm

re-use module in other test-suite/solution

Post by davyb » Wed Sep 04, 2013 1:27 pm

Hello
I'm quite new to Ranorex.
For the moment I've created some scripts for one of our products in one solution / suite.

I have a 2nd product which I should automate, but i want to re-use some of the modules/code modules I've created in my first test suite (e.g running some scripts to rollback a database...). They are exactly the same, but only the parameters (which database) are different.

I do not want to copy them to another test-suite, because if something changes, I need to change x-times the same scripts. Is there a way to re-use modules in another testsuite without copying them?

Thanks !

nickdandakis
Posts: 7
Joined: Fri Aug 09, 2013 9:21 am

Re: re-use module in other test-suite/solution

Post by nickdandakis » Wed Sep 04, 2013 3:19 pm

You can set a reference in your new solution to the executable generated from the first solution. Expand the project, right click on "References" and add a new reference.

davyb
Posts: 6
Joined: Wed Sep 04, 2013 12:58 pm

Re: re-use module in other test-suite/solution

Post by davyb » Wed Sep 04, 2013 3:39 pm

Thx for the answer :D ( & sorry for the probably 'stupid' question ;) )
Works like a charm!

davyb
Posts: 6
Joined: Wed Sep 04, 2013 12:58 pm

Re: re-use module in other test-suite/solution

Post by davyb » Wed Sep 04, 2013 3:44 pm

Extra question about maintainability:
Is it propably better to move all 'shared' modules to another solution (e.g called "framework") and only include this solution in all other solutions, or could this lead to other issues?

nickdandakis
Posts: 7
Joined: Fri Aug 09, 2013 9:21 am

Re: re-use module in other test-suite/solution

Post by nickdandakis » Wed Sep 04, 2013 3:52 pm

davyb wrote:Extra question about maintainability:
Is it propably better to move all 'shared' modules to another solution (e.g called "framework") and only include this solution in all other solutions, or could this lead to other issues?
I'm fairly sure that's the right way of doing it. That's how we do it, at least. One solution is the "framework", created and maintained by the Automation Test Engineer, from which the modules are used in other solutions by Automation Testers to create the test runs they need.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: re-use module in other test-suite/solution

Post by krstcs » Wed Sep 04, 2013 3:57 pm

Yes, you can do it that way.

However, I think there is an even better way...

You can have everything in the same solution, but have different Test Suite projects in the solution (make sure you choose Ranorex->Test Suite as the project type when adding the new project and not Test Library, which is the default). This allows you to only have to open one solution, but still have each project be separate.

I have one solution for each domain (eCommerce, mobile, systems, etc.). Each solution has a CORE or COMMON project that contains all of the common functionality that all projects in that domain would need, and then I just add Test Suite projects for each test campaign, like so:

Code: Select all

- eCommerce Test Suite
  -> eCommerce_CORE
  -> eCommerce_User_Login
  -> eCommerce_Purchase_Product_while_Logged_In
  -> eCommerce_Purchase_Product_as_Guest
Shortcuts usually aren't...

davyb
Posts: 6
Joined: Wed Sep 04, 2013 12:58 pm

Re: re-use module in other test-suite/solution

Post by davyb » Wed Sep 04, 2013 7:09 pm

Thx... I think it's important do know all these things just to do it right from the start ;)
Our team will have to automate several separated programs. For each program I think to make a seperate solution with a separate framework (solution) for the common functions.
One of our programs contains several modules / domains, and I think those are best grouped into one solution with different test suites.
Isn't there some 'recommended' setup or 'best practises' about this setup (solutions, test suites, "frameworks"-solutions/test suites,...)?