How to: dynamically create workflows?

Class library usage, coding and language questions.
AdamHepner
Posts: 7
Joined: Thu Oct 20, 2011 1:55 pm

How to: dynamically create workflows?

Post by AdamHepner » Thu Oct 20, 2011 2:20 pm

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?
Adam Hepner
REC Solutions sp. z o.o.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to: dynamically create workflows?

Post by Support Team » Thu Oct 20, 2011 4:20 pm

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

AdamHepner
Posts: 7
Joined: Thu Oct 20, 2011 1:55 pm

Re: How to: dynamically create workflows?

Post by AdamHepner » Thu Oct 20, 2011 5:40 pm

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...?
Adam Hepner
REC Solutions sp. z o.o.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to: dynamically create workflows?

Post by Support Team » Fri Oct 21, 2011 10:28 am

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

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: How to: dynamically create workflows?

Post by artur_gadomski » Fri Dec 02, 2011 8:37 am

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.