How to use the output of a module as input of the next one

Ranorex Spy, Recorder, and Studio.
monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

How to use the output of a module as input of the next one

Post by monkey2012 » Tue Oct 30, 2012 7:01 pm

I have 2 different user code modules, name Module1.rxrec and Module2.rxrec

In Module1.rxrec, one of the steps using user code module named Module1.UserCode.cs as below:

public string Function_1(string input1, string input2)
{
return output1;
}

In Module2.rxrec, there is also one of the steps using user code module named Module2.UserCode.cs as below:
public void Function_2(string input3, string input4)
{
.....
}

but input3 is the output from the function called Function_1 in Module1.rxrec

If I setup a testcase that includes these 2 recording modules, and I want to use the output1 data from the first module and use it as input in the second recording module, is this possible?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to use the output of a module as input of the next one

Post by Support Team » Wed Oct 31, 2012 2:36 pm

Hi,

Yes, this is possible!
I would bind the output of the first module and the input of the second module to a global parameter of the test suite. This will ensure that the input3 variable will be set to the value of the output variable.
Don't forget to use a Module Variable for the input and output parameter, otherwise you cannot bind them to the global parameter in the test suite.
For more details see the attached sample solution.

Regards,
Markus
Attachments
SampleSolution1.7z
(133.05 KiB) Downloaded 254 times
.
Image

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: How to use the output of a module as input of the next one

Post by monkey2012 » Wed Oct 31, 2012 7:12 pm

Thank so much!

mojohlic
Posts: 31
Joined: Thu Oct 11, 2012 4:37 pm

Re: How to use the output of a module as input of the next one

Post by mojohlic » Tue Nov 20, 2012 12:24 am

Hi Markus,

This sample is awesome and it helped me a lot but. How can i do the same thing when the parameter to use is a string[]? like output1 = {"label1","label2"}

thanks

Support Team wrote:Hi,

Yes, this is possible!
I would bind the output of the first module and the input of the second module to a global parameter of the test suite. This will ensure that the input3 variable will be set to the value of the output variable.
Don't forget to use a Module Variable for the input and output parameter, otherwise you cannot bind them to the global parameter in the test suite.
For more details see the attached sample solution.

Regards,
Markus

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to use the output of a module as input of the next one

Post by Support Team » Tue Nov 20, 2012 1:17 pm

Hi,

Thanks :)!
You have to convert the String Array to a String before you can bind it to a variable(is always a String), here is a link to a page where it is described how this could work: String Array to String.
I hope this will help you solve the problem.

Regards,
Markus
.
Image