title: Not sure What I am missing? Getting data null
body: <p>I am trying to write data from website to excel , But in my write data method , I am getting 10 null values instead of actual values. </p>
  
  <p>Code is here :</p>
  
  <pre><code>import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  import org.apache.poi.ss.usermodel.Cell;
  import org.apache.poi.ss.usermodel.Row;
  import org.apache.poi.ss.usermodel.Sheet;
  import org.apache.poi.ss.usermodel.Workbook;
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.chrome.ChromeDriver;
  
  public class Retrieve {
  
    public static WebDriver driver;
    public static int rowcount=0;
    public static int cellcount=0;
  
    public static String T1,T2,T3,T4,T5,T6,T7,T8,T9,T10;
    public static String data[] = new String[10];
  
    public static void main(String[] args) throws IOException {
      openurl();
      write_data();
    }
  
    public static void openurl() {    
  
      System.setProperty("webdriver.chrome.driver", "E:\\Selenium-Webdriver\\Chrome_Driver\\chromedriver.exe");
      driver = new ChromeDriver();
  
      driver.get(URL);
  
      T1 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[1]/td[2]/a/b")).getText();
      T2 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[2]/td[2]/a/b")).getText();
      T3 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[3]/td[2]/a/b")).getText();
      T4 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[4]/td[2]/a/b")).getText();
      T5 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[5]/td[2]/a/b")).getText();
      T6 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[6]/td[2]/a/b")).getText();
      T7 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[7]/td[2]/a/b")).getText();
      T8 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[8]/td[2]/a/b")).getText();
      T9 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[9]/td[2]/a/b")).getText();
      T10 = driver.findElement(By.xpath("//*[@id='wpv-view-layout-34546-CPID79']/table/tbody/tr[10]/td[2]/a/b")).getText();   
    }
  
    public static void write_data() throws IOException {
      File file = new File("C:\\Users\\Documents\\Practice.xls"); 
      FileInputStream inputStream = new FileInputStream(file);
  
      Workbook MyWorkbook = null;  
      MyWorkbook = new HSSFWorkbook(inputStream);
  
      Sheet sheet = MyWorkbook.getSheet("sheet1");
  
      Row row = sheet.getRow(0);
  
      try {   
        int lendgth = data.length;
        for(int i = 0;i &lt; data.length;i++) {   
          Row newrow = sheet.createRow(rowcount+1);
          Cell cell = newrow.createCell(cellcount);
  
          if(!data[i].equals("") || data[i].equals(null)) { 
            cell.setCellValue(data[i]);
            rowcount++;    
          }    
        }
      }catch(Exception E) {
        E.printStackTrace();      
      }   
      inputStream.close();    
      FileOutputStream outputStream = new FileOutputStream(file);
  
      MyWorkbook.write(outputStream);  
      outputStream.close();   
    }
  }
  </code></pre>
  
  <p><strong>I am getting all data null at : <code>if(!data[i].equals("") || data[i].equals(null))</code> and Getting nullpointerexception.</strong></p>