title: Reading data from file using DataProvider in testng
body: <p>Let's say I have a text file with the following data</p>
  
  <pre><code>username=testuser
  password=testpassword
  email=test@test.com
  address=testaddress
  zipcode=12345
  </code></pre>
  
  <p>Or I have an XML with the following data</p>
  
  <pre><code>&lt;TestData&gt;
     &lt;UserInfo&gt;
         &lt;username&gt;testuser&lt;/username&gt;
         &lt;password&gt;testpassword&lt;/password&gt;
         &lt;email&gt;test@test.com&lt;/email&gt;
         &lt;address&gt;testaddress&lt;/address&gt;
     &lt;/UserInfo&gt;
  &lt;/TestData&gt;
  </code></pre>
  
  <p>I have a test as below</p>
  
  <pre><code>public class DPTest {
  
     @Test(dataprovider="testdp")
     public void userTest_01(String username, String Password) {
  
     //Test goes here
  
     }
  }
  </code></pre>
  
  <p>Another class</p>
  
  <pre><code>public class DPTest2 {
  
     @Test(dataprovider="testdp")
     public void userTest_02(String email, String address, String password) {
  
     //Test goes here
  
     }
  }
  </code></pre>
  
  <p>Can my dataprovider read the values from the above mentioned text file or XML and supply it to the test methods?</p>
  
  <p>As per my understanding the data provider is going to read all the lines in the text file and supply it to the test method and throw an error saying "data provider is trying to provide 6 parameters but Test can only accept 2 parameter" ?</p>
  
  <p>Please help me.</p>