Any body now how to open the excel file using opening append mode............
this my code every time it open the new excel.......
package Jobwork;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.concurrent.TimeUnit;
import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
public class Sulekha {
WritableWorkbook wb;
static int rv = 0;
public static void fun(WebDriver driver,String city,String sval)
{
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
Select Sel =new Select(driver.findElement(By.id("CityDrpDwn")));
Sel.selectByVisibleText(city);
WebElement search = driver.findElement(By.id("SearchInput"));
search.sendKeys(sval);
WebElement ele = driver.findElement(By.id("ui-id-1"));
List <WebElement> listv = ele.findElements(By.tagName("li"));
PrintWriter pr=null;
String path = "D:\\s.txt";
wb = Workbook.createWorkbook(new File("D:\\s1.xls"));
WritableSheet sh = wb.createSheet("Suresh", 1);
int cv = 0;
for(WebElement wval : listv)
{
Label l1 = new Label(cv,rv,i);
sh.addCell(l1);
cv++;
}
cv =0;
rv++;
}
wb.write();
wb.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//diver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);
search.clear();
System.out.println("completed");
}
public static void geturl(WebDriver driver,String url)
{
driver.get(url);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriver driver = new FirefoxDriver();
geturl(driver,url);
fun(driver,"Chennai","Individual House");
fun(driver,"Bangalore","Rent House");
fun(driver,"Hyderabad","2BHK");
fun(driver,"Bangalore","1BHK");
fun(driver,"Kolkata","Approved Plots");
}
}