Get next Date using Selenium IDE / javascript -
i can current date if use this...
command: storeeval target: var d=new date(); ('0' + (d.getmonth()+1)).slice(-2)+'/'+('0' + d.getdate()).slice(-2) + '/' +d.getfullyear() value: testdate
actual result > 05/14/2015
but need next date , not appearing format wanted. let today's date 05/14/2015, need output of 05/15/2015. have failing
command: storeeval target: var d=new date(); ('0' + (d.getmonth()+1)).slice(-2)+'/'+(d.setdate(d.getdate() + 1)) + '/' +d.getfullyear() value: testdate
actual result > 05/1431642394763/2015
expected result > 05/15/2015
*also above didn't mention slice, need work if days go 1-9.
please need step in selenium ide, suggestions.
found answer @ javascript how tomorrows date in format dd-mm-yy
command: storeeval target: var d= new date(new date().gettime() + (86400000 *2)); ('0' + (d.getmonth()+1)).slice(-2)+'/'+('0' + d.getdate()).slice(-2) + '/' +d.getfullyear() value: testdate
expected , actual result > 05/16/2015
Comments
Post a Comment