TestNG - test is being skipped without executing. | Selenium Forum
M
Posted on 05/10/2016
Hi All,

I am facing problem with TestNG. Here i am providing the code. Dont know the reason why it has been skipped every time. please suggest the solution.

//code here
package test;

import org.testng.annotations.Test;
import org.testng.annotations.DataProvider;

public class YahooRegistrationTest {

@Test(dataProvider="registerData")
public void testRegister(String username, String password, String email, String city){

System.out.println(username +" -- "+password +" -- "+email +" -- "+city);

}
@DataProvider
public Object[][] registerData(){

bject[][] data= new Object[3][4];

// 1st row
data[0][0]="user1";
data[0][1]="pass1";
data[0][2]="email1";
data[0][3]="city1";

// 2nd row
data[1][0]="user2";
data[1][1]="pass2";
data[1][2]="email2";
data[1][3]="city2";
//3rd row
// 1st row
data[2][0]="user3";
data[2][1]="pass3";
data[2][2]="email3";
data[2][3]="city3";

return data;

}

}

//below is the result i got

[TestNG] Running:
C:\Users\VIHITHA\AppData\Local\Temp\testng-eclipse--431531001\testng-customsuite.xml

[Utils] Attempting to create C:\workspace\Module9\test-output\Default suite\Default test.xml
[Utils] Directory C:\workspace\Module9\test-output\Default suite exists: true
SKIPPED: testRegister
java.lang.NoClassDefFoundError: com/google/common/primitives/Ints
at org.testng.internal.annotations.JDK15TagFactory.createDataProviderTag(JDK15TagFactory.java:335)
at org.testng.internal.annotations.JDK15TagFactory.createTag(JDK15TagFactory.java:59)
at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:217)
at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:111)
at org.testng.internal.Parameters.findDataProvider(Parameters.java:326)
at org.testng.internal.Parameters.findDataProvider(Parameters.java:261)
at org.testng.internal.Parameters.handleParameters(Parameters.java:418)
at org.testng.internal.Invoker.handleParameters(Invoker.java:1240)
at org.testng.internal.Invoker.createParameters(Invoker.java:980)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1070)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:746)
at org.testng.TestRunner.run(TestRunner.java:600)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)
at org.testng.TestNG.runSuites(TestNG.java:1104)
at org.testng.TestNG.run(TestNG.java:1076)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
Caused by: java.lang.ClassNotFoundException: com.google.common.primitives.Ints
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 27 more


===============================================
Default test
Tests run: 1, Failures: 0, Skips: 1
===============================================


===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 1
===============================================

[TestNG] Time taken by org.testng.reporters.jq.Main@28f67ac7: 38 ms
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\toc.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\Default test.properties
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\index.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\main.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\groups.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\classes.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\reporter-output.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\methods-not-run.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\Default suite\testng.xml.html
[Utils] Directory C:\workspace\Module9\test-output\old\Default suite exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\old\index.html
[Utils] Directory C:\workspace\Module9\test-output\old exists: true
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@649d209a: 23 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@71c7db30: 4 ms
[Utils] Attempting to create C:\workspace\Module9\test-output\testng-failed.xml
[Utils] Directory C:\workspace\Module9\test-output exists: true
[Utils] Attempting to create C:\workspace\Module9\test-output\Default suite\testng-failed.xml
[Utils] Directory C:\workspace\Module9\test-output\Default suite exists: true
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 7 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@45c8e616: 4 ms
[Utils] Attempting to create C:\workspace\Module9\test-output\junitreports\TEST-test.YahooRegistrationTest.xml
[Utils] Directory C:\workspace\Module9\test-output\junitreports exists: true
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@7cf10a6f: 3 ms

M
Replied on 05/10/2016

It seems below jar is not available in your classpath. com.google.guava_1.6.0.jar

Download from the link below and add it to your classpath.

[b:1088818u][u:1088818u]Link to Download:[/u:1088818u][/b:1088818u]
http://www.java2s.com/Code/Jar/c/Downloadcomgoogleguava160jar.htm

download the Jar and add it in your Build Path for particular project


M
Replied on 05/10/2016

Hi Ayyappa,

I have downloaded the jar file you mentioned and added to the project. Still i am getting the same result.

Thanks,
Vihitha


M
Replied on 05/10/2016

Are You getting same exception


M
Replied on 05/10/2016

Yes Appayya.. i am getting the same exception even after adding the jar file you mentioned.


M
Replied on 05/10/2016

Please use TestNG version of 6.9.12 or Higher and try again and make sure you have the jar added in your project that i suggested you to download


M
Replied on 05/10/2016

I am currently using Eclipse Neon . Please let me know will it support TestNg or not. If TestNg is not supported by EClipse Neon i will download the Other version of Eclipse.

Kindly let me know the correct version of Eclipse that supports TestNg


M
Replied on 05/10/2016

Please use Eclipse Indigo Version

I am also using same and TestNG is working for me


M
Replied on 05/10/2016

Ok, thank you for the help

Its working now with Eclipse Neon also. I just changed the location of my project and installed TestNg.

Finally i got the Correct result.

user1 -- pass1 -- email1 -- city1
user2 -- pass2 -- email2 -- city2
user3 -- pass3 -- email3 -- city3
[Utils] Attempting to create E:\Selenium-Practice\Module9\test-output\Default suite\Default test.xml
[Utils] Directory E:\Selenium-Practice\Module9\test-output\Default suite exists: true
PASSED: testRegister("user1", "pass1", "email1", "city1")
PASSED: testRegister("user2", "pass2", "email2", "city2")
PASSED: testRegister("user3", "pass3", "email3", "city3")

===============================================
Default test
Tests run: 3, Failures: 0, Skips: 0
===============================================


===============================================
Default suite
Total tests run: 3, Failures: 0, Skips: 0
===============================================