Documentation and Books

Recent site activity

SeleniumIDE‎ > ‎

How to use the current date in a Selenium script?

This can be done by using a storeExpression action, put this action in the beginning of your Selenium Script:

  <tr>
<td>storeExpression</td>
<td>javascript{var date = new Date();date.getDate() +
'-' + (date.getMonth()+1) + '-' + date.getFullYear();}
</td>
<td>currentDate</td>
</tr>

Now you can use the currentDate variable somewhere else in you script:

  <tr>
<td>type</td>
<td>startDate</td>
<td>${currentDate}</td>
</tr>