18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Date picker is not work

gunjangunjan Members
edited November -1 in Sahi - Open Source
Hi my name is gunjan.
I m using windows 7,sahi V3.5 and browser fire fox 5.0

i want to fetch data from excel sheet and send it on to browser.

My problem is that when i select date it display 11/7/2011
but when i run the script it display 2011-7-11 00:00:00
and i can't save my form because of this date formate

can u plz help me what should i do for this?

my script is given below:

function towerform($companyname,$password,$taxid,$fname,$lname,$phone1,$phone2,$email,$add,$zip,$status,$createdby,$closedate,$closewonby,$insexpdate)
{



_setValue(_textbox("txtCompanyName"), $companyname);
_setValue(_textbox("txtPassword"), $password);
_setValue(_textbox("txtFederalTaxID"), $taxid);
_setValue(_textbox("txtFirstName"), $fname);
_setValue(_textbox("txtLastName"), $lname);
_setValue(_textbox("txtPhone1Code"), $phone1);
_setValue(_textbox("txtPhone1"), $phone2);
_setValue(_textbox("txtEmail"), $email);
_setValue(_textbox("txtAdd1"),$add);
_setValue(_textbox("lstZipCode"), $zip);
_setSelected(_select("Status"), $status);
_setSelected(_select("txtCreatedBy"), $createdby);
_wait(15000,_exists(elememt));
_setValue(_textbox("txtCloseDate"), $closedate);
//_click(_row(19));
_setSelected(_select("txtCloseWonBy"), $closewonby);
_wait(15000,_exists(elememt));
_setValue(_textbox("InsExpDate"), $insexpdate);
//_click(_cell("Reason Lost:"));
//_click(_checkbox("SameAs"));
//_click(_submit("Save"));

}
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}; DBQ=C:\\Test Data\\Book12.xls;readOnly=false", "", "");

$rs = db.select("select * from [Sheet1$]");

for(var $i=0; $i<1; $i++)
{
towerform($rs[$i]["txtCompanyName"], $rs[$i]["txtPassword"],""+parseInt($rs[$i]["txtFederalTaxID"]), $rs[$i]["txtFirstName"], $rs[$i]["txtLastName"],$rs[$i]["txtPhone1Code"],$rs[$i]["txtPhone1"],$rs[$i]["txtEmail"], $rs[$i]["txtAdd1"],""+parseInt($rs[$i]["lstZipCode"]),$rs[$i]["Status"], $rs[$i]["txtCreatedBy"],$rs[$i]["txtCloseDate"],$rs[$i]["txtCloseWonBy"],$rs[$i]["InsExpDate"]);
_click(_checkbox("SameAs"));
_click(_submit("Save"));
_wait(15000,_exists(elememt));
}
my excel sheet is given below:

txtCompanyName txtPassword txtFederalTaxID txtFirstName
ABC_0000 wqw123 123456789101112 Reena



txtLastName txtPhone1Code txtPhone1 txtEmail txtAdd1
Roy 232 243-9876 r@r.com india street



lstZipCode Status txtCreatedBy txtCloseDate xtCloseWonBy
78727 Active MCM 11/7/2011 MCM



InsExpDate
12/8/2015


in my application i want 11/7/2011 date format not 2011-7-11 00:00:00


Plz can u help me and reply me fast?

Waiting for your favorable reply


Thanks,
Gunjan.

Comments

  • please any one help me how to solve this problem?
  • Hi gunjan,

    Your excel sheet should be:

    txtCloseDate
    '11/7/2011 . Check if this solves you issue.

    Regards
    Sumitra
  • just min. i will check and tell u after 10 min
  • it's works perfect thank u so much.my senior tester much more happy to listen this news.
  • thanks once again i spent to days to solve this problem thank u very very much




    Gunjan.
This discussion has been closed.