Page 1 of 1

How to: dynamically create workflows?

Posted: Thu Oct 20, 2011 2:20 pm
by AdamHepner
In my current project, it makes sense to dynamically create test case out of smaller building blocks.

It means, that I'd rather have a runtime-built test case containing other testcases (along with all the data-bindings and setup/teardown), than a static flow with all possible testcases in it, where every testcase starts and eventually checks if it makes sense to run it currently.

So, my question is: how do I programmatically operate objects like TestSuite, TestCase, TestModule, DataSource?

Then, I'd create pre-defined code/recording modules at design-time. At the runtime, after parsing configuration, I'd create sufficient number of test cases, each of which would consist of specific steps (sub-testcases) made of specific test-steps (modules) repeated given number of times with appropriate data-bindings. Each of the test cases would consist of only required test steps, hence the report would look nice and clean.

Is there a way to do it in such way?

Re: How to: dynamically create workflows?

Posted: Thu Oct 20, 2011 4:20 pm
by Support Team
Hi,

If you want to interact with the TestSuite, TestCases, TestModules, please take a look to following API Documentation.
http://www.ranorex.com/Documentation/Ra ... esting.htm

Regards,
Peter
Ranorex Team

Re: How to: dynamically create workflows?

Posted: Thu Oct 20, 2011 5:40 pm
by AdamHepner
Well, I don't want to interact with them, I want to create them :). I've read through aformentioned documentation, I hacked a little bit in trial, but haven't been able to find, what I have in mind...?

Re: How to: dynamically create workflows?

Posted: Fri Oct 21, 2011 10:28 am
by Support Team
Hi,

Usually it is possible but we have no documented API for this and we don't suggest our users to create their own test suites/test cases. For sure it's not that big deal, but if you want to use the data context then it starts to get complex.

Regards,
Peter
Ranorex Team

Re: How to: dynamically create workflows?

Posted: Fri Dec 02, 2011 8:37 am
by artur_gadomski
How about just wraping your modules into test cases and testsuite?
TestReport.BeginTestSuite("Suite");

TestReport.BeginTestCase("Test case A");
MyModuleA();
if (confition)
{
    MyModuleB();
}
TestReport.EndTestCase();
TestReport.SaveReport();
Of course each module must contain BeginModule and EndModule methods so the report looks nice.