Tuesday, 28 July 2015

How to add date format to string / append date format to string

Date date = new Date() ;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss") ;
File file = new File(dateFormat.format(date) ) ;
String name="prava1";
d.findElement(By.xpath("//*[@id='Email']")).sendKeys(name+"_"+file);

No comments:

Post a Comment