Parameter annotation in Junit code
// Paramter annotation in junit
@RunWith(value=Parameterized.class)
public class Case2 {
String uname, pass;
public Case2(String uname, String pass)
{
this.uname = uname;
this.pass = pass;
}
@Test
public void TestCase()
{
System.setProperty("webdriver.chrome.driver","C:\\Documents and Settings\\Administrator\\My Documents\\Downloads\\chromedriver_win32_2.1\\chromedriver.exe");
ChromeDriver f = new ChromeDriver();
f.get("http://mail.in.com");
f.findElementById("f_id").sendKeys(uname);
f.findElementById("f_pwd").sendKeys(pass);
f.findElementByClassName("signin");
}
@Parameters
public static List Para()
{
Object arr[][]={{"uname","pass"},
{"uname1","pass1"},
{"unam22","pass2"}};
return Arrays.asList(arr);
}
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment