Not getting the changed or new value from excel. | Selenium Forum
M
Posted on 29/11/2015
Hi ,

If I am changing the values or adding anything new in excel

the executing the following code but it is not giving the updated value in ecplise.It is giving the old value everytime.

Can you please suggest, where i am doing mistake?

package test;

import com.qtpselenium.util.Xls_Reader;

public class testRunmode {

public static void main(String[] args) {
// TODO Auto-generated method stub
Xls_Reader x = new Xls_Reader(System.getProperty("user.dir")+ "\\src\\com\\qtpselenium\\xls\\A Suite.xlsx");
isTestCaseRunnable(x,"TestCase_A1");
Xls_Reader x1 = new Xls_Reader(System.getProperty("user.dir")+ "\\src\\com\\qtpselenium\\xls\\B Suite.xlsx");
isTestCaseRunnable(x1,"TestCase_B1");

}

//return true if runmode of the test is equal to yes
public static boolean isTestCaseRunnable(Xls_Reader xls, String testCaseName){

for(int i=2; i<=xls.getRowCount("Test Cases"); i++){
String tcid = xls.getCellData("Test Cases", "TCID", i);
String runmode = xls.getCellData("Test Cases", "Runmode", i);
System.out.println(tcid +"---"+ runmode);
System.out.println();
}


return false;

}

}

M
Replied on 29/11/2015

can't see anything wrong with your code.

how do you handle xlsx files? do you save and close them before running you program?


M
Replied on 30/11/2015

I have done with the both way.

1) First I changed the value and Save it. Then I executed the code but It didnt fetch the new values from xlsx.
2) I also kept my file open and changed the values still didnt fetch the new values from xlsx.

Kindly suggest

Thanks
Rohan


M
Replied on 30/11/2015

can you upload xlsx file?