For random number generation in Selenium RC, I have the code but it is not working properly in Webdriver. If I use the below code in webdriver, it is returning null. Please find the code below in webdriver
String Randnum = (String) ((JavascriptExecutor) driver).executeScript("var d=new Date().getFullYear()+new Date().getDate().toString()" +
"+new Date().getDay()" +
"+new Date().getHours()" +
"+new Date().getMinutes()" +
"+new Date().getSeconds()" +
"+new Date().getMilliseconds()");
Please help me out on this… Help will be appreciated.
Why can’t you try the same thing using Java?