DATE TIME PARAMETER
WHAT IS DATE TIME PARAMETER ?
Date Time Parameter is a parameter by which
we can get current system date and time.
With the help of this parameter we can get
system date and time in different formats which
are provided by Date Time Parameter.
There are 16 predefined formats
There is an option Custom Format. Using this
option you can design your desired format.
In this parameter there are 7 fields out of which
3 are Mandatory and rest are Optional
DATE TIME PARAMETER’S GUI LOOKS
LIKE AS SHOWN:-
DESCRIPTION OF FIELDS
Parameter Name :
This field is used to set the name of Date Time
Parameter which is used in parameterization of the
script. It is a mandatory field.
Parameter Name should be in valid form:First character of Parameter Name must be an alphabet.
Other characters can be alphabet, numeric or underscore(_).
Special characters and space are not valid characters for
Parameter Name
Format :This field is used to set the format of Date Time
Parameter. It is a mandatory field.
There are 16 predefined formats.
Other Option is Custom Format. With the help of this
option we can define our own format.
Sample(Current Date/Time) :This field contains sample format of selected Format.
It is in disabled form means we cannot change its
value.
Offset Parameter by :
With the help of this field we can step-up/down
current Date and time.
We can perform steps in two ways Positive and
Negative.
For future dates it should be positive and for past it
should be negative.
We can offset by days, hours, minutes and seconds.
By default it always steps up in positive way means
it gives future date/time.
Prior to Date :
By checking this check box we set the offset in
negative way means for past date/time .
Day Type:
This field is used to tell Netstorm the type of the day
which we have chosen.
It consists of three options All Days, Working Days
and Non Working Days.
All days means all days whether its working or not.
Working Days means working day nearest to the offset
date.
Non Working Days means non working day nearest to the
offset date.
By default All Days is selected.
Update Value on:This field value tells Netstorm when to take new
Date Parameter value.
This field has two options Session and Use
Session :- In this option Netstorm will generate value once
for Date Time parameter and use that value for entire
session.
Use :- In this option Netstorm will generate new value
every time for Date Time Parameter in the entire script
where ever parameter is used.
Unique for each Session
If this option is selected, then Netstorm will generate
unique date/time for all NVMs and for all user.
STEPS TO DECLARE DATE TIME
PARAMETER
Open Script Manager and select a script in which
you want to use Date Time Parameter.
And select specific file i.e. if you are using Legacy
type script, then choose script.capture and if you
are using C type script then choose
registration.spec.
Now there are two ways to get Date Time
Parameter GUI
One is from Menu Bar.
Another is by doing right click in the Right Pane of
specific file.
As you can see in below snapshots respectively.
Date Time Parameter by Menu Bar
Date Time Parameter by Right Click in Right Pane
Click on Date Time Parameters you will get the
following screen.
Click on Add you get the following frame.
Set values for fields as you want, for example as shown
below and click on OK.
Then click on Close here.
After that you will get the following API in your file (in
registration.spec or in script.capture).
nsl_date_var(date,
Format="%m/%d/%Y",
Offset=2.00:00:00, Refresh=USE);
DayType=WORKING,
Now Parameterize the desired page of your script with
Date Time Parameter date.
Example :- I have parameterized the Index Page
Before Parameterization Page looks like
ns_web_url ("index_html",
"URL=http://192.168.1.40:81/tours/index.html",
"HEADER=Accept-Language: en-IN",
INLINE_URLS,
"URL=http://192.168.1.40:81/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-IN", END_INLINE,
"URL=http://192.168.1.40:81/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-IN", END_INLINE,
);
Page after parameterization is as follows :-
ns_web_url ("index_html",
"URL=http://192.168.1.40:81/tours/index.html?{date}",
"HEADER=Accept-Language: en-IN",
INLINE_URLS,
"URL=http://192.168.1.40:81/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-IN", END_INLINE,
"URL=http://192.168.1.40:81/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-IN", END_INLINE,
"URL=http://192.168.1.40:81/tours/Merc10dev/images/sun_swede.gif", "HEADER=Accept-Language: enIN", END_INLINE,
"URL=http://192.168.1.40:81/tours/Merc10-dev/images/login.gif",
"HEADER=Accept-Language: en-IN", END_INLINE,
"URL=http://192.168.1.40:81/tours/images/banner_merctur.jpg",
"HEADER=Accept-Language: en-IN", END_INLINE
);
Then click on Save Button below the Menu bar
Now execute the scenario .
Now for viewing the results
Type :
vi url_req_0_0_0_0_0_0_0_0_0.dat
You will get following output:
GET /tours/index.html?%2211%2F18%2F2011%22
HTTP/1.1^M
Host: 192.168.1.40:81^M
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows
NT 6.0; WOW64; Trident/4.0; SLCC2; .NET CLR
2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729;
Media Center PC 6.0; InfoPath.2; .NET4.0C)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/html
;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q
=0.^M
Accept-Encoding: gzip, deflate, compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-IN^M
^M
EXAMPLES!!
EXAMPLE - 1
Set values in the following manner then click on OK.
In above snapshot I only gave the parameter name and
all the remaining fields have their default values.
After that the API will be.
nsl_date_var(date, Format="%m/%d/%Y", Refresh=SESSION);
Now parameterize the page. It will looks like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-us", END_INLINE,
);
Changes that I made are shown in blue color.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/html
;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q
=0.^MAccept-Encoding: gzip, deflate, compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"11/18/2011"^M
^M
Changes are mentioned in Blue colored fonts.
EXAMPLE - 2
Set values in the following manner then click on OK.
In above snapshot I have given the parameter name in
alpha-numeric format, changed the format and all the
remaining fields have their default values.
After that the API will be.
nsl_date_var(date1, Format="%m/%d/%y",
Refresh=SESSION);
Now parameterize the page. It will look like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date1}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif", "HEADER=AcceptLanguage: en-us", END_INLINE,
);
Changes that I made are shown in blue color.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"11/18/11"^M
^M
Changes are mentioned in Blue color.
EXAMPLE - 3
Set values in the following manner then click on OK.
In above snapshot I have used underscore in the
parameter name, changed the format and all the
remaining fields have their default values.
After that the API will be.
nsl_date_var(date_a, Format="%Y/%m/%d",
Refresh=SESSION);
Now parameterize the page. It will looks like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date_a}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-us", END_INLINE,
);
Changes are shown in blue color.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"2011/18/11"^M
^M
Changes are mentioned in Blue colored.
EXAMPLE - 4
Set values in the following manner then click on OK.
In above snapshot I am trying to use space in the
parameter name, change the format and all the
remaining fields have their default values.
After clicking on OK it is giving error message.
If you are trying to use any special character in
parameter name you will get the same error
message.
You can also try with the other formats given in
the drop down list of Format field note what
changes will appear in APIs and in Outputs
Custom Format is described below.
EXAMPLE - 5
Set values in the following manner then click on OK.
In above snapshot I have given parameter name,
selected Custom Format, used @ symbol as seprator and
all the remaining fields have their default values.
After that the API will be.
nsl_date_var(date, Format="%d@%m@%Y", Refresh=SESSION);
Now parameterize the page. It will looks like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-us", END_INLINE,
);
Changes are shown in blue color texts.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"18@11@2011"^M
^M
Changes are mentioned in Blue color.
EXAMPLE - 6
Set values in the following manner then click on OK.
In above snapshot set parameter name, select Format,
set Offset value as 2 days and 1 hour and all the
remaining fields are on their default values.
Expected results date will be 11-20-11 and time will be
16:27 (present date/time 11-18-11/15:27).
After that the API will be.
nsl_date_var(date,
Format="%m-%d-%y/%H:%M",
Offset=2.01:00:00, Refresh=SESSION);
Now parameterize the page. It will looks like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-us", END_INLINE,
);
Changes that I made are shown in blue color.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"11-20-11/16:27"^M
^M
Changes are mentioned in Blue colored fonts.
EXAMPLE - 6
Set values in the following manner then click on OK.
In above snapshot set parameter name, select Format, set
Offset value as 2 days and 1 hour, check Prior to date and all
the remaining fields have their default values.
Expected results date will be 2011-11-16 (present date 18-112011) here time will not be shown because format is selected
for date only.
After that the API will be.
nsl_date_var(date,
Format="%Y-%m-%d",
Refresh=SESSION);
Offset=
-2.01:00:00,
Now parameterize the page. It will look like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif", "HEADER=Accept-Language:
en-us", END_INLINE,
);
Changes that I made are shown in blue color texts.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"2011-11-16"^M
^M
Changes are mentioned in Blue colored fonts.
EXAMPLE - 7
Set values in the following manner then click on OK.
In above snapshot set parameter name, select Format, set
Offset value 2 days, Day type as ‘Working Days’ and all the
remaining fields have their default values.
Expected results date will be 2011-11-21 (present date is 18-112011, Friday. After two days on 20th, it will be Sunday which is
not a working day. So, Netstorm generates 21-11-11).
After that the API will be.
nsl_date_var(date,
Format="%Y-%m-%d",
Offset=2.00:00:00, Refresh=SESSION);
DayType=WORKING
Now parameterize the page. It will looks like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif", "HEADER=Accept-Language:
en-us", END_INLINE,
);
Changes that I made is shown in blue color texts.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"2011-11-21"^M
^M
Changes are mentioned in Blue colored fonts.
EXAMPLE - 8
Set values in the following manner then click on OK.
In above snapshot set parameter name, select Format, set
Offset value 3 days, check Prior to Date, Day type as ‘Non
Working Days’ and all the remaining fields have their default
values.
Expected results date will be 2011-11-13 (present date 18-112011 Friday before three days on 15 it will be Tuesday and it
is a working day according to Netstorm so, It generates 13-1111).
After that the API will be.
nsl_date_var(date, Format="%Y-%m-%d",
Offset=-3.00:00:00, Refresh=SESSION);
DayType=NONWORKING,
Now parameterize the page. It will looks like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif", "HEADER=Accept-Language:
en-us", END_INLINE,
);
Changes that I made is shown in blue color texts.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"2011-11-13"^M
^M
Changes are mentioned in Blue colored fonts.
EXAMPLE - 9
Set values in the following manner then click on OK.
In above snapshot set parameter name, select Format,
set Offset value 1day, Update Value On ‘Use’ and all the
remaining fields have their default values.
Expected results date will changes every time.
After that the API will be.
nsl_date_var(date, Format="%m-%d-%y/%H:%M", Refresh=USE);
Now parameterize the page. It will looks like :
ns_web_url ("reservation",
"URL=http://192.168.1.35:83/cgi-bin/reservation",
"HEADER=Accept-Language: en-us{date}####{date}",
INLINE_URLS,
"URL=http://192.168.1.35:83/tours/Merc10dev/images/banner_animated.gif",
"HEADER=AcceptLanguage: en-us", END_INLINE,
);
Changes that I made is shown in blue color texts.
After that Output will be:
GET /cgi-bin/reservation HTTP/1.1^MHost:
192.168.1.35:83^M
User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_epoll
i686)^M
Accept:
text/xml,application/xml,application/xhtml+xml,text/ht
ml;q=0.9,text/plain;q=0.8,video/xmng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*
;q=0.^MAccept-Encoding: gzip, deflate,
compress;q=0.9^M
Keep-Alive: 300^M
Connection: keep-alive^M
Accept-Language: en-us"19-11-2011"####“19-11-2011"^M
^M
Changes are mentioned in Blue colored fonts.
Page Dump
Date time Parameter cannot be evaluated by Page
Dump at present. Regarding this refer Bug ID “Bug
1322”.
Virtual User Trace
Date Time Parameter is currently not supported by
Virtual User Trace.(Build # 3.8.1.7)
THANKS !!!!
© Copyright 2026 Paperzz