Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

Date Assertion is failing

I am using the following function to enter date field in my form and when I am trying to assert it, it's failing.

function GetDate(){
var $wdate =_getValue(_textbox("date-picker-date"));
var $i = $wdate.indexOf(" ");
var $h = _getText(_textbox(6));
if ($h[0] == "0") {
$h = $h[1]}
if ($wdate.substring($wdate[$i] == "0")) {
$i = $wdate.indexOf("0")+1}
$wdate = $wdate.substring(0,3 ) + " " + $wdate.substring($i) + " " + $h + ":" + _getText(_textbox(7)) + " " + _getText(_button(47)).toLowerCase();
return $wdate;

var $wdate = GetDate();

As per my function, $wdate should display today's date, but when I insert _alert($wdate) it's not logging the expected date. The same code is working in few other scripts and it is failing in some. The scripts which are failing now have passed successfully earlier. Anybody can help me on this one, please.
Sign In or Register to comment.