Share a recording across test suites

Best practices, code snippets for common functionality, examples, and guidelines.
HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Share a recording across test suites

Post by HansSchl » Tue Nov 10, 2020 10:28 am

Hi,

I created a solution that contains several test suites each of which contains test runs. I want to share recordings across these suites. For example:
- Test suite A defines the recording module "LaunchSomething"
- Test case X, contained in Test suite B, calls "LaunchSomething"
I went ahead and tried it, dragging the recording into text case X, and the test suites and their respective tests were fine and did what they should, running on my workstation.

Then I wanted to run test suite B on a remote Ranorex agent. The result was that it couldn't find any of test suite A's recordings.

I understand that the agent's situation is different from the situation on my workstation. How to solve the problem? Would a module library be the right way to go? Or do I need to supply additional DLLs to the agent?

Thank you
Hans
Last edited by HansSchl on Thu Nov 19, 2020 8:20 am, edited 1 time in total.

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: Share a ecording across test suites

Post by Stub » Tue Nov 10, 2020 10:35 am

If the recordings, Test Suite A and Test Suite B are all within the same Ranorex project then A and B should both have access to the recordings. Did things get built correctly?

We have tons of common recordings in our project that are shared between multiple Test Suites. We also have module libraries to share recordings and code modules between entirely different projects.

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Share a recording across test suites

Post by HansSchl » Tue Nov 10, 2020 10:58 am

Hi Stub, thank you for replying.

I don't know where a recording is actually "stored" when the solution is compiled. Maybe I failed to supply the respective file to the agent. (In fact I don't know which files the agent sees - Ranorex handles this behind curtains which I haven't been able to open yet...)

Or can the build process be wrong? I build the project in Ranorex Studio when I run (and debug) it locally, but for remote execution, I let our CI tool build the project, which in essence is an msbuild script that takes the Ranorex-generated *.sln file as its input.

Hans

User avatar
Stub
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: Share a ecording across test suites

Post by Stub » Tue Nov 10, 2020 12:34 pm

A recording consists of three files. The .rxrec, a .cs, and a UserCode.cs, all with the same base name. Have they all been added to source control? Though I would expect the build to fail if the files were referenced by the .csproj and thus missing when the .sln gets built.

HansSchl
Posts: 143
Joined: Wed Sep 19, 2018 10:05 am

Re: Share a ecording across test suites

Post by HansSchl » Wed Nov 11, 2020 3:37 pm

@Stub, thank you for your comments and suggestions which encouraged to further explore the situation. I found two things wrong with TestSuiteB, and fixed that. Now it works :D

1 - In Ranorex Studio, I must add a reference from TestSuiteB to TestSuiteA. Obviously, TestSuiteA.exe contains code that TestSuiteB.exe wants to execute.
2 - When running TestSuiteB, I need not only TestSuiteA.exe and TestSuiteB.exe, but also TestSuiteB.exe.config, *.rxtmg, and/or *.rxtst. I was not curious enough to find out which of them are really required, just added all three.

I believe that Ranorex Studio had added the reference but it may have got lost when I was in a hurry to commit my code.