Can I skip or exit a test case based on a condition?

Class library usage, coding and language questions.
KenBobPDX
Posts: 8
Joined: Tue Feb 24, 2015 5:30 pm

Can I skip or exit a test case based on a condition?

Post by KenBobPDX » Thu Jun 25, 2015 4:30 pm

We have a standard suite of test cases that we want to run against different data services. We want to have different test cases run based upon the different data services we pass in as arguments. Is there a way to selectively run test cases based upon the address of the data service we are running against?

Alternatively, can we exit a test case if the data service address doesn't match a known value within the test case? I don't want to mark the test as failed, but would rather mark the test as "skipped". That way our reporting mechanism doesn't falsely report a failure for a test case simply because the data service was not the correct one for the test case.

We are running Ranorex Studio 5.3.1.22939 and coding the tests in C#. The application under test is a WinForms application running in .net 4.0 and .net 2.0.

Any suggestions would be greatly appreciated. Thanks.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Can I skip or exit a test case based on a condition?

Post by krstcs » Thu Jun 25, 2015 7:38 pm

For future reference, the site has a very good search feature (the magnifying glass on the white banner at the top of the page). There are already a few threads that are similar to your request.

See this thread for something that should get you where you are wanting to go:
http://www.ranorex.com/forum/how-to-sto ... tml#p24582
Shortcuts usually aren't...

KenBobPDX
Posts: 8
Joined: Tue Feb 24, 2015 5:30 pm

Re: Can I skip or exit a test case based on a condition?

Post by KenBobPDX » Thu Jun 25, 2015 8:03 pm

Thanks. Actually I the article regarding starting a test-case by a condition is going to be more relevant to what we need. I tried to post a link, but apparently I'm too new to have that privilege. :P