Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, windows and java based applications. Get your 30 day free trial.
Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com
Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com
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.
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.