title: How to pass parameters programmatically in testng
body: <p>I have a framework, where in one method it returns two Excel sheet rows say:</p>
  
  <pre><code>Row[0]="Name","Age","Location"
  Row[1]="Uday","34","India"
  </code></pre>
  
  <p>Here I call my TestNG testcase as below.</p>
  
  <pre><code>TestNG testng = new TestNG();
  testng.setTestClasses(new Class[] { myCls.Class });
  testng.run()
  </code></pre>
  
  <p><strong>But how I can pass above two rows of data to my class(myCls)?</strong></p>
  
  <p>I need to pass these values to my testcase(say: class myCls) which have a @Test method.</p>
  
  <p>I heard about <strong>@DataProvider</strong> in TestNG, but I don't know how to use in the above code.</p>