Hi,
how can i start from my codeModule ( m1 ) the codeModule ( m2 )?
normally i just have to create an object of the other module and execute the "run" methode but in this case
it is for some reasons not working...
I hope you cann help me.
BR
Patrick
Start Code module from code modle
Re: Start Code module from code modle
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Start Code module from code modle
yeah... i already saw this and tried it out. So when i have created an instance i am NOT able to select the run() method with it...
i attached a screen
i attached a screen
You do not have the required permissions to view the files attached to this post.
Re: Start Code module from code modle
That's weird. Are you sure the module in question is a Ranorex code module (with ITestModule.Run() section) and not just a plain class?
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Start Code module from code modle
strangely, if i put all the stuff which is inside the run method into a new separate method and call this method in the run method. Gladly we are able to call this method from the other code module.
I am not sure if this is the smartest solution...
So if you have any advice for me, let me know it.
Thanks a lot
I am not sure if this is the smartest solution...
So if you have any advice for me, let me know it.
Thanks a lot
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Start Code module from code modle
Hi mapa,
You could do the following:
Robin
You could do the following:
var us = new UserCodeModule1(); TestModuleRunner.Run(us);Hope this helps,
Robin
Re: Start Code module from code modle
Thx it is working so far.
The problem is that my datas are not bound anymore when i execute it via the code
The problem is that my datas are not bound anymore when i execute it via the code
- RobinHood42
- Posts: 324
- Joined: Fri Jan 09, 2015 3:24 pm
Re: Start Code module from code modle
Hi mapa,
I'm afraid a correct databinding can just be ensured, when executing the whole test suite and not by running or programmatically calling individual modules.
Cheers,
Robin
I'm afraid a correct databinding can just be ensured, when executing the whole test suite and not by running or programmatically calling individual modules.
Cheers,
Robin
Re: Start Code module from code modle
is this a planed feature for upcoming versions ?
Re: Start Code module from code modle
Hi,
I don't think that there is such feature planned (starting code module from code with binded data connector). But you can always make a feature request (using user voice platform). You see, the data connectors are always bound to TestCase/SmartFolder and starting recording/code module from code is not recommended approach, because it may break the test flow. This is why you should use the test suite.
What you can do is to add the code module into SmartFolder, which you can dynamically enable/disable from code, based of the actual test state. This way you will be sure the code module is properly filled with data from Data Connector and the test flow will be much more straightforward.
I don't think that there is such feature planned (starting code module from code with binded data connector). But you can always make a feature request (using user voice platform). You see, the data connectors are always bound to TestCase/SmartFolder and starting recording/code module from code is not recommended approach, because it may break the test flow. This is why you should use the test suite.
What you can do is to add the code module into SmartFolder, which you can dynamically enable/disable from code, based of the actual test state. This way you will be sure the code module is properly filled with data from Data Connector and the test flow will be much more straightforward.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Start Code module from code modle
Yeah, if you call a module from inside another module, then you have to set the values of the inner-modules variables in code, Ranorex doesn't know that you are doing this (and it isn't supported or recommended by the Ranorex team, btw).
I have had to do this before when I needed to reset an SUT after an error in the run (I just wrapped all of the shutdown/startup modules in a single code module with an if() and manually set the values of the variables from the outer-module's bindings).
I would recommend looking at ways to change your approach to the automation before actually trying this because it's a maintenance headache in the long-run.
I have had to do this before when I needed to reset an SUT after an error in the run (I just wrapped all of the shutdown/startup modules in a single code module with an if() and manually set the values of the variables from the outer-module's bindings).
I would recommend looking at ways to change your approach to the automation before actually trying this because it's a maintenance headache in the long-run.
Shortcuts usually aren't...