title: How to loop this test with different csv row?
body: <p>I am beginner with selenium tests. I wrote this code and it works, but I need to loop this test with another csv line. </p>
  
  <p>I spent almost 10 hours trying to do this.</p>
  
  <p>Scenario of what I am trying to do:</p>
  
  <ol>
  <li><p>The web browser is opening  go to url </p></li>
  <li><p>login with data from CSV file from first line </p></li>
  <li><p>Driver is restarting and do the same but with data from second line from csv file. </p></li>
  </ol>
  
  <p>I also tried to restart test with aftermethod/afterclass but it's not working.</p>
  
  <pre><code>public class CSVdataread {
      private WebDriver driver;
      String baseUrl = "URL";
      String CSV_file = "C:\\Users\\xxxxxxxxxxx\\Desktop\\TestData.csv";
  
      @BeforeClass
      public void openBrowser() {
          System.setProperty("webdriver.chrome.driver", "C:\\Users\\xxxxxxxxxxxx\\Desktop\\webdriver\\chromedriver.exe");
          driver = new ChromeDriver();
          driver.navigate().to("URL");
          driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
      }
  
      @Test
      public void verify_Search() throws InterruptedException, IOException {
          CSVReader reader = new CSVReader(new FileReader(CSV_file));
          String[] cell;
  
          while((cell = reader.readNext()) != null) 
              for (int i = 0; i &lt; 1; i++) {
                  String name = cell[i];
                  String email = cell[i + 1];
                  String baseUrl = "http://xxxxx.xxx/xxxx/";
                  driver.findElement(By.xpath("//input[@id='useridFormField-inputEl']")).sendKeys(name);
                  driver.findElement(By.xpath("//input[@id='userpasswordFormField-inputEl']")).sendKeys(email);
                  {
                      driver.quit();
                  }
              }
          }
      } 
  </code></pre>