jeudi 5 novembre 2015

How to check if the current time falls within specific range with selenium IDE?

I need to check if the current time is within 6:00 and 18:00. How to use if in this situation? I get the current time in format hhmi

var d= new Date(); 
var h=((d.getHours())<10)?'0'+(d.getHours()):(d.getHours()); 
var n=((d.getMinutes())<10)?'0'+(d.getMinutes()):(d.getMinutes());
' '+h+n;

and need to do something like this in selenium IDE:

if 600 < ${currentTime} < 1800

do something;

else

do something;

Aucun commentaire:

Enregistrer un commentaire