Testlink plugin - Fetching results of Testcases with Data Providers

100 views
Skip to first unread message

rauto

unread,
Jan 16, 2015, 4:48:06 PM1/16/15
to jenkins...@googlegroups.com
Hi,

I have automation test cases written in Java + Selenium + TestNG. These tests are run in Jenkis and results are integrated to Testlink using Testlink plugin. I have Data Providers to provide data to the test methods. For example,

// The dataprovider provides 3 data sets (hence 3 test cases)
@DataProvider
public Object[][] testSumInput() {
   return new Object[][] { { 5, 5 }, { 10, 10 }, { 20, 20 } };
}

// Test method calling dataprovider (executes 3 times)
@Test(dataProvider = "testSumInput")
public void testSum(int a, int b) {
   System.out.println("@Test : testSum()");
   int result = service.sum(a, b);
   Assert.assertEquals(result, a + b);
}

In Jenkins, I am using the result seeking strategy as - TestNG method name and data provider name
In Testlink I have defined one test case with two custom fields (since Testlink does not allow me to create test cases with the same name 3 times).

When I run the test, I get a single pass or fail. I want to get 3 results (pass / fail) since I have 3 rows in my Data Provider. How to achieve this? If anybody has tried using Data Provider with more than one set of data, please let me know how you set it up.

Thanks.



jenkins.png

Walter Kelt

unread,
Jan 16, 2015, 5:29:38 PM1/16/15
to jenkins...@googlegroups.com
Don't think you can accomplish 3 separate tests with data provider. You can use testng params and feed in the data using testng testsuite Xml. You'd run 3 separate tests.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/471404b6-afb3-4302-9994-dc3b7a0823f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<jenkins.png>

rauto

unread,
Feb 5, 2015, 3:41:04 PM2/5/15
to jenkins...@googlegroups.com
Hi,

If I have 3 rows in dataprovider, TestNG report gives three results (pass /fail). But in testlink it shows as one result. So if one of the three test cases actually failed in TestNG, Testlink shows one failure. I want to show one out of the three failed.

If this cannot be achieved, why do we have a result seeking strategy 'TestNG method name and data provider name'? There should be some difference between seeking using just 'method name' and 'method name + dataprovider'. Am I missing something?

Thanks
Reply all
Reply to author
Forward
0 new messages