title: Get element if from excel Sheet
body: <p>I had created my script to validate my actual result and expected result , .</p>
  
  <p>As there is too many link to validated script will get too much of coding m so i need to convert this into Data Driven Case ,.</p>
  
  <p>Where Webdriver will get URL , xpath ,expected value from excel .</p>
  
  <p>But dont know how to proceed , .</p>
  
  <p>A demo code is much appreciated</p>
  
  <p>Here is my current script :</p>
  
  <pre><code>public void test() throws Exception
  {
      String home_logo_url="158321";
      String enough_talk_promo="1057406";
  
      System.out.println("Check for home_logo_url");  
      driver.get(baseUrl);
      String SiteWindow = driver.getWindowHandle(); // get the current window handle
      driver.findElement(By.xpath("//*[@id='logo']/a")).click();
      for (String PromoWindow : driver.getWindowHandles()) 
      {
          driver.switchTo().window(PromoWindow); // switch focus of     WebDriver to the next found window handle (that's your newly opened window)
      }
          String script = "return rlSerial;";
          String value = (String) ((JavascriptExecutor)driver).executeScript(script);
          Assert.assertEquals(value,home_logo_url);
          driver.close();
          driver.switchTo().window(SiteWindow);
          System.out.println("Pass");
  
          System.out.println("Check for enough_talk_promo");
          driver.get(baseUrl + "/category/tournaments/");
          driver.findElement(By.xpath("//*[@id='content']/div/div[4]/aside/div/div/p[1]/a")).click();
          for (String PromoWindow : driver.getWindowHandles())
          {
              driver.switchTo().window(PromoWindow); // switch focus of WebDriver to the next found window handle (that's your newly opened window)
          }
          String sr_enough_talk_promo = (String) ((JavascriptExecutor)driver).executeScript(script);
          Assert.assertEquals(sr_enough_talk_promo,enough_talk_promo);
          driver.close();
          driver.switchTo().window(SiteWindow);
          System.out.println("Pass");
  
  
    } 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/0HO1X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0HO1X.png" alt="Here is field i had created "></a></p>
  
  <p>How to iterated to each rows and get my test case run !!!</p>
  
  <p>It is much helpful , if some one can convert my existing code to work on excel sheet .</p>
  
  <p>Thanks </p>