Currently I am using Selenium 3.0 with the TestNG framework and a page factory setup for maintaining the page setup. I have been using wini for fetching data from the text file using section and option name.
- What are alternative ways for a Data-Driven approach?
- How can use I them for running same test case but with different set of data?
Please elaborate with examples Here is how i am currently accessing it with section and option name.
@BeforeClass (alwaysRun=true)
public void setup(ITestContext context) throws Exception{
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource("datafile.txt").getFile());
crmdatafile = new ReadData(file.getAbsolutePath());
}
@Test
public void setcontact(){
Section section= crmdatafile.data.get("Contact_Buyer");
ContactsPage.Select_Profile_Title(section.get("Title"));
ContactsPage.Select_Profile_Contactlanguage(section.get("Contact_language"));
}
This is how i have been fetching data from wini data text file where my datafile looks like
[Contact_Buyer]
Title = Madam
Contact_language = French
etc
how can i achieve this using dataprovider to pass multiple values(many section and option names)