Page 1 of 1

How to execute one test case from another

Posted: Mon Apr 25, 2016 8:02 pm
by ninaddande
Hi Folks,

I have a question on internal calling of test case from the code of another test case. Actually my scenario is, I have one test case of 10 steps and second test case of 12 steps which has first 10 steps as the first test case.

So I want to find out an option if we can execute first test case from second one and continue with remaining 2 steps of second test. And in this way both the test should come in report with only one execution cycle when we execute the test suite.

Is it possible?

Kindly guide me for this.

Regards,
ND

Re: How to execute one test case from another

Posted: Tue Apr 26, 2016 8:03 am
by odklizec
Hi,

I believe there is no option (definitely not official) to start a test case from code. In fact, I think such approach would cause a lot of mess in test project workflow and I would strongly advise not to use such way, even if exists ;)

I think the best approach to solve your problem is to use run configurations. basically, you can have two separate Test Cases and with Run Configuration you can define which Test Cases should be run. Here is an example how to use Run Configurations to solve your problem...
RunConfigExample.png

Re: How to execute one test case from another

Posted: Tue Apr 26, 2016 5:42 pm
by ninaddande
Hi odklizek,

Thanks for your response. Actuall this approach will not suffice as I have test suite with multiple test case which we have to execute weekly so I can not create different runs as such and in any way if I understand this then it will execute both the test cases in one run separately. However I was trying to find the solution which will have single run for both combined (i.e one execution for both) but it should produce report for 2 separate test cases.

Is there any other possibility to do so in other than code.

Regards,
ND

Re: How to execute one test case from another

Posted: Tue Apr 26, 2016 7:49 pm
by krstcs
There is one report for each test suite, unless you used code, which I don't recommend.

My suggestion would be to use the method that Pavel suggested, but create a batch file to run both, one after the other.

Don't over-think it. When people get in trouble with Ranorex it is usually because they tried to force it into doing things a different way than it is designed, but if you change your mentality a bit and rethink how you are approaching the actual test problem, you can do what you really need to do without to much effort. Remember, this isn't a manual test, so don't try to make it work just like manual testing. :D

Hope that helps...

Re: How to execute one test case from another

Posted: Tue Apr 26, 2016 11:03 pm
by ninaddande
Thanks, I will try with this approach if I can manage.

Re: How to execute one test case from another

Posted: Mon May 02, 2016 10:36 am
by Mudhenn
Hello

Not sure if I understand your problem right, but maybe there is something in this for you: I work actually on a automated test in which I want to select different recordings for each test-cylce. I am working on an form with different sub-forms and in the test scenarois the "user" should use different parts in every cycle.

So I have an excel-sheet with the different combinations to select (just true or false) and one "recording" for every part of that form.On the beginning of each cycle the code checks or unchecks the recordings which should be executed.

If that corresponds with your problem let me know, I can post you the code to do this.

best regards,
Frank