How to read a specific value from Excel sheet using Selenium WebDriver TestNG Data Provider Method?
<p>Following is the code:-</p>

<pre><code>package sanityTests;

import java.io.File;
import java.io.IOException;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;


import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

public class DataDrivenTest2 {


    @Test (dataProvider= "testdata")  //attribute

    public void add(String x , String y){
        int a= Integer.parseInt(x);   //Convert String to integer
        int b = Integer.parseInt(y);
        int z=a+b;
        System.out.println(z);
    }


    @DataProvider(name="testdata")   //annotation for TestNG


    public Object [] [] readExcel() throws BiffException, IOException   //Way of Object Declaration of Array.Main Method Removed because of test NG Framework
{       

        File f = new File("C:/Users/Ishan/Desktop/Input2.xls");  //Create File Object to locate file on system
        Workbook w = Workbook.getWorkbook(f); //Activate the Workbook
        Sheet s = w.getSheet(0);  //Activate Sheet (either by name or id). Id starts with 0
        int rows= s.getRows() ; //Get Row Count
        System.out.println(rows); //Get Column Count
        int columns = s.getColumns();
        System.out.println(columns);

    String InputData[] [] = new String [rows] [columns];  //Array to read data from excel file

    for(int i=0; i&lt;rows; i++){
        for(int j=0; j&lt;columns;j++){
            Cell c =s.getCell(j, i);  // Getting location of cell

            InputData[i][j] =c.getContents();
        System.out.println(InputData[i][j]);


    }

}
    return InputData;
}
}
</code></pre>

<p>Now it is returning me all the values and the sum of the values mentioned in the Input Excel. Following is the input values </p>

<p>1   2
3   4
5   6</p>

<p>Now I want to only select values from specific row and column say Row 1 , Column 1 and add them and show the sum. I have tried to enter 1,1 in the Input Data Field but I am not getting the output. Please help.</p>