Module 9 -TestNG -- DataProvider Anotation | Selenium Forum
M
Posted on 10/08/2016
Hi Please help me to solve this problem.
Test "[b:34pwe29z]yahooRegistrationTest.java[/b:34pwe29z]" file with"[b:34pwe29z]DataProvider[/b:34pwe29z]" Annotation. After run individual or run with [b:34pwe29z]testng.xml [/b:34pwe29z]file it display below error message so please suggest me where i am wrong.

NOTE:- Project attached with screenshot.
[b:34pwe29z]NOTE:- Waiting for you reply.[/b:34pwe29z]

Code:-

package test;

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

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(){

Object [][] data = new Object[2][4];

data[0][0] = "sumit";
data[0][1] = "sumit1123";
data[0][2] = "sumit1123@gmail.com";
data[0][3] = "Delhi";

data[1][0] = "sumit";
data[1][1] = "sumit1123";
data[1][2] = "sumit1123@gmail.com";
data[1][3] = "Delhi";

return data;
}

}

M
Replied on 10/08/2016

Please Reply on that....


M
Replied on 11/08/2016

Any update..


M
Replied on 11/08/2016

This error means that the class was available at compile time, but cannot be found during run time. It most commonly happens when your compile time classpath is different from your runtime classpath.

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

com.google.guava_1.6.0.jar
http://www.java2s.com/Code/Jar/c/Downloadcomgoogleguava160jar.htm

PS:please wait 24 hours for a reply.


M
Replied on 11/08/2016

Thanks. Its Working Ashish.