Generate TestNg.xml Dynamically code
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");
XmlSuite suite = new XmlSuite();
suite.setName("OMS");
XmlTest test1 = new XmlTest(suite);
test1.setName("TCase1");
List<XmlClass> classes = new ArrayList<XmlClass>();
classes.add(new XmlClass("org.nitin.TCase1"));
List<XmlSuite> suite_a = new ArrayList<XmlSuite>();
suite_a.add(suite);
TestNG tng = new TestNG();
tng.setXmlSuites(suite_a);
tng.run();
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment