How to set test cases priority (Java test cases integrated in TestNG framework)

608 views
Skip to first unread message

vikas shitole

unread,
Sep 10, 2013, 5:04:23 AM9/10/13
to testng...@googlegroups.com
Hi All,


    We have 100+ test cases written in java on testNG framework. No test cases have priority set (P0/P1/P2) at the moment. My query is how to set these priorities across all test cases unsing TestNG feature? 
What is that feature which would help to complete this task? 


Regards
Vikas

Alexander Poulikakos

unread,
Sep 11, 2013, 2:32:29 AM9/11/13
to testng...@googlegroups.com

Maybe you could use groups? See chapter 5.2 http://testng.org/doc/documentation-main.html#test-groups

 

/Alex

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/groups/opt_out.

vikas shitole

unread,
Sep 12, 2013, 1:27:12 PM9/12/13
to testng...@googlegroups.com
Hi Alex,

 Thanks a lot for your input. I have some followup questions 

1. By using groups feature. : 

  My tests are designed as follows:
>>>Every test have i)test setup method  ii)actual test method iii)cleanup method
>>>I need to use annotation (@Test) for each method. am I right?
>>>If say, this test class extends one base class. do we need to add @Test annotation with groups even for super class method as well? 

2. we use ANT tool to execute our testNG suite (all tests) through command line. can we send groups value( in our case priority) dynamically as one parameter. so that it would automatically execute specified priority test cases from test suite? we do not want to create separate test suites for each priority level.

Thanks in advance.


-Vikas


On Wednesday, 11 September 2013 12:02:29 UTC+5:30, drapostolos wrote:

Maybe you could use groups? See chapter 5.2 http://testng.org/doc/documentation-main.html#test-groups

 

/Alex

 

From: testng...@googlegroups.com [mailto:testng...@googlegroups.com] On Behalf Of vikas shitole
Sent: den 10 september 2013 11:04
To: testng...@googlegroups.com
Subject: [testng-users] How to set test cases priority (Java test cases integrated in TestNG framework)

 

Hi All,

 

 

    We have 100+ test cases written in java on testNG framework. No test cases have priority set (P0/P1/P2) at the moment. My query is how to set these priorities across all test cases unsing TestNG feature? 

What is that feature which would help to complete this task? 

 

 

Regards

Vikas

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.

To post to this group, send email to testn...@googlegroups.com.

Venkatesh Singh

unread,
Sep 30, 2013, 6:51:05 AM9/30/13
to testng...@googlegroups.com
you need @Test only for actual test method, super class method does not need @Test.

@Test signifies the test you intend to run don't use it for helper methods.
Reply all
Reply to author
Forward
0 new messages