Tuesday, March 5, 2013

Selenium IDE - How get Current - date, month, year & time through script

Selenium IDE - How get Current - date, month, year & time through script


There are many ways like as below:

1.

Current Time - javascript{(new Date().getHours()+" : " + new Date().getMinutes() + " : " + new Date().getSeconds())}

Current year - javascript{(new Date()).getFullYear()}

Current Month - javascript{(new Date().getMonth()) + 1}

Current date - javascript{(new Date().getDate().toString())}



2. 


<tr> 
        <td>storeEval</td> 
        <td>var d=new Date(); d.getDate()+'-'+((d.getMonth()+1)) 
+'-'+d.getFullYear();</td> 
        <td>date2</td> 
</tr> 
<tr> 
        <td>echo</td> 
        <td>${date2}</td> 
        <td></td> 
</tr> 




3. 

No comments:

Post a Comment