how to call dynamic RecordingModule in user code

Ranorex Studio, Spy, Recorder, and Driver.
Alpha13
Posts: 8
Joined: Thu Feb 23, 2023 3:56 pm

how to call dynamic RecordingModule in user code

Post by Alpha13 » Thu Mar 23, 2023 11:55 am

Hello, I would like to know if some of you find a solution to make a dynamic recording module in script, i have found some informations but nothing specific worked.

i got two recording module :
TestCallRecordModule
TestStartExe (start an exe)

I need the recording module "TestCallRecordModule" to call a user code with this function :
CallRecordingModule(string nameRecording)

I want to specifiy the recording module to execute named " TestStartExe"

I can execute this in C# which work.
 
[UserCodeMethod]
		public static void CallRecordingModule(string nameRecording)
		{ 
                     TestStartExe.Start();
        }
 
Is there a way to change this TestStartExe by a variable nameRecording ?

mrt
Posts: 257
Joined: Mon Mar 16, 2020 11:31 am

Re: how to call dynamic RecordingModule in user code

Post by mrt » Thu Mar 23, 2023 1:38 pm

Calling recordings directly from user code should only be a very very last resort, because it makes your test suite very hard to follow and maintain.

In your case, this recording does not more than running an .exe?

Then I would suggest running the .exe from c# code with something like

Code: Select all

Process.Start("C:\\myApp.exe");
rather than starting a recording which runs the .exe then.

In this case you can pass the filePath as any string you want and only need one recording.

User avatar
doke
Posts: 112
Joined: Fri Mar 29, 2019 2:33 pm

Re: how to call dynamic RecordingModule in user code

Post by doke » Wed Mar 29, 2023 2:28 pm