Databinding absent when calling TestModuleRunner.Run

Ranorex Spy, Recorder, and Studio.
carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Databinding absent when calling TestModuleRunner.Run

Post by carsonw » Mon Jun 24, 2013 10:04 pm

It's a little complicated to explain why I need to do this... but simply put I am trying to call one code module from another code module.

When I run this code:

Code: Select all

TestModuleRunner.Run(new GPWorkflow());
It runs the commands in the void ITestModule.Run() method (which is what I wanted it to do).

However, there is no databinding of any kind, so the module basically does nothing. The module does not recognize any of the databindings for its datasource and does not know that there are many rows to be executed.

Essentially it's behaving as if it had NO datasource. This is confusing because this: http://www.ranorex.com/Documentation/Ra ... er_Run.htm says:
Runs the configured test module instance, providing data binding to its public properties marked with the TestVariableAttribute
which suggests to me it should work. Am I doing something wrong or is what I'm trying to do not possible?

Hopefully this is enough detail, if not I can try and explain the whole picture of what we're trying to do and why (maybe there is a different way), but trying to spare everyone from the huge wall of text. Thanks!

Carson.

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

Re: Databinding absent when calling TestModuleRunner.Run

Post by Support Team » Tue Jun 25, 2013 3:38 pm

Hello Carson,

I am afraind that I didn't quite catch what you are trying to do.
It is possible to start a UserCodeModule from another module, but this is not recommended because it will break the workflow.
However you can us the TestModuleRunner.Run() as you did to start another module.
For example :
var myCodeModule = new UserCodeModule2();
TestModuleRunner.Run(myCodeModule);
Unfortunately it is only possible to use the variable, which is bound to the data connector if you insert the module into your test suite.
Please let me know if I didn't understand you correctly.

Regards,
Bernhard
.
Image

carsonw
Posts: 178
Joined: Tue Nov 08, 2011 10:01 pm

Re: Databinding absent when calling TestModuleRunner.Run

Post by carsonw » Tue Jun 25, 2013 9:16 pm

Oh I think I see...

So if CodeModule A is bound to DataSheet 1 and calls CodeModule B (using TestRunner.Run) which is bound to DataSheet 2 - only binding from DataSheet 1 will be available?

CodeModule B will not be able to use the bindings from it's own databinding (DataSheet 2).

Is that right?

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

Re: Databinding absent when calling TestModuleRunner.Run

Post by Support Team » Wed Jun 26, 2013 5:29 pm

Hello,

Yes, that's right. This is one reason that it is not recommended to call a user code module from another module.

Regards,
Bernhard
.
Image