How to: dynamically create workflows? : Automation API

How to: dynamically create workflows?

Class library usage, coding and language questions.

How to: dynamically create workflows?

Postby AdamHepner » Thu Oct 20, 2011 3: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.
AdamHepner
 
Posts: 7
Joined: Thu Oct 20, 2011 2:55 pm

Re: How to: dynamically create workflows?

Postby Support Team » Thu Oct 20, 2011 5: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
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: How to: dynamically create workflows?

Postby AdamHepner » Thu Oct 20, 2011 6: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.
AdamHepner
 
Posts: 7
Joined: Thu Oct 20, 2011 2:55 pm

Re: How to: dynamically create workflows?

Postby Support Team » Fri Oct 21, 2011 11: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
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: How to: dynamically create workflows?

Postby artur_gadomski » Fri Dec 02, 2011 9: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.
User avatar
artur_gadomski
 
Posts: 125
Joined: Mon Jul 19, 2010 7:55 am
Location: Copenhagen, Denmark


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests