I'm testing my web application using Selenium IDE. There are test cases in which I have to assert that today's date appears on the page. I cannot hard code today's date in the test because today's date changes every day. How do I get the current day, month & year in Selenium IDE?
Not sure what format your date is in, but you could do something like this:
<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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With