18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
URGENT !!!!! Partial value save in a variable
can we save the partial value in a variable
e.g. the text is
Submitted by Super User on 03/05/2009
Now, i just want to save the value "03/05/2009" in a variable.
e.g. the text is
Submitted by Super User on 03/05/2009
Now, i just want to save the value "03/05/2009" in a variable.
Comments
In this text, "Submitted by Super User on 03/05/2009"
this date is dynamic and "Super User" is the first name and last name of user and is also dynamic...
I need to store the date only in a variable... irrespective of this text ...
this solution seems to be working...
but there is a little problem
date To field is a date picker...once i selected the date using date picker...i am unable to store this date in a variable....and this is a shop stopper to this entire solution....
Please provide solution for this...
Script i am using :
var $date;
_set($date, _getText(_textbox("id")));
Actually, in the text:
"Submitted by Bradd Nathan on 05/03/2009"
Here the date is variable...(which i need to store in a variable)
the user name "Bradd Nathan" is also variable ...but the solution u gave is ok to me...
Code:
$s = "Submitted by Super User on 03/05/2009"
$s = $s.replace(/.*[ ]/, ""); //
Here, in the solution u provide, the date has become hard coded (03/05/2009)...now everytime, in the variable $s, it will store the date as "03/05/2009"...while in this variable i need to store the varible date....
Please provide ur solution... as this has stopped my progress...
if its always the current date than you can try this:
var $now = new Date();
var $monthday = $now.getDate();
var $month = parseInt($now.getMonth()) + 1;
var $year = $now.getFullYear();
var $currentDate = $month + "/" + $monthday + "/" + $year;
$s = "Submitted by Super User on " + $currentDate;
$s = $s.replace(/.*[ ]/, "");
Regards,
Pankaj.
if yes, than you can store it in a variable first and then use it.
$s = "Submitted by Super User on 03/05/2009"
was an example.
You would mostly have to do this Btw, I did not understand your problem regarding Did you get a solution for it?
Regards,
Narayan
if it is a textbox with some prefilled data (date), i think
var $date;
_set($date, _getText(_textbox("id").value));
should work.
Regards,
Pankaj.
var $date;
_set($date, _textbox("id").value);