Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unique Number Parameter

Similar presentations


Presentation on theme: "Unique Number Parameter"— Presentation transcript:

1 Unique Number Parameter

2 Unique Number Parameter is used to generate unique number across all of the users.
Unique number generated is And if value is updated then only increment of 1 (sequentially) takes place.

3 Unique No. window looks like as follows::

4 Description of all the fields:: 1.Parameter Name
‘Parameter name’ is a ‘Unique no. parameter Variable Name’ which is used to access this parameter in the entire script. Variable name consists of only English alphabet and _ (it also accepts alpha-numeric name).

5 2.Format Length of the no. generated can be specified here.
It can have following values:- %01lu %02lu %03lu %04lu %05lu %06lu %07lu %08lu %09lu If the length of the number generated is less than the specified length, then it is left padded with zeros.

6 5.Update Value On This field is used to tell Netstorm when to generate new string: It has two options:- Session use

7 Session:: Means generate unique once and use this value for the entire session. i.e. If ‘session’ is chosen, unique no. is generated only for first use of unique no. Parameter. Then for the entire script, same value is used. Use:: Means generate unique no. every time Random String Parameter is used. i.e. If ‘Use’ is chosen, unique no. is generated for each use of unique no. Parameter. For example::If unique no. Parameter is used 50 times in script, then in case of ‘use’, for every reference, new no. is generated. Next generated no. is incremented by 1 for its each use.

8 Example:- In this example, we will generate a Random Number for Credit Card number and parameterize it on Confirmation Page.

9 In registration.spec file, right-click in right pane and choose Parameters > Unique Number Parameter

10 Click on ADD button   Set following values:-

11 Click on OK > Close. Following API will be inserted in registration
Click on OK > Close. Following API will be inserted in registration.spec file:- nsl_unique_number_var(CreditCard, Format=%08lu, Refresh=SESSION); Click on SAVE button. Double click on flow file and parameterize Credit Card number available on Confirmation Page.

12 After parameterization, it will look like as shown below:-
ns_web_url ("Confirmation", "URL= address1=4261+Stevenson+Blvd.&address2=Fremont%2C+CA+94538&pass1=Scott+Tiger&creditCard={CreditCard}&expDate=12%2F2%2F&oldCCOption=&numPassengers=1&seatType=Coach&seatPref=None&outboundFlight=000%7C0%7C &advanceDiscount=&.cgifields=saveCC&buyFlights.x=76&buyFlights.y=13", "HEADER=Accept-Language: Z",

13 INLINE_URLS, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE );

14 Click on Save button and execute scenario
Click on Save button and execute scenario. Now look at request with number 5. It will look as follows:- GET /cgi-bin/findflight?firstName=Tiger&lastName=Scott&address1=4261+Stevenson+Blvd..&address2=Fremont%2C+CA+94538&pass1=Scott+Tiger&creditCard= &expDate=12%2F2%2F&oldCCOption=&numPassengers=1&seatType=Coach&seatPref=None&outboundFlight=000%7C0%7C &advanceDiscount=&.cgifields=saveCC&buyFlights.x=76&buyFlights.y=13 HTTP/1.1 Host: :83 User-Agent: Mozilla_CA/4.79 [en] (X11; U; Linux d_epoll i686) Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0. Accept-Encoding: gzip, deflate, compress;q=0.9^M Keep-Alive: 300 Connection: keep-alive Accept-Language: Z Value substituted by NetStorm is shown in bolds.

15 Ex: Parameter Name No special symbols are allowed

16 Space is not allowed

17 Numeric value is not allowed

18 Alpha-numeric value is acceptable

19 Ex : Update Value On ‘Session’
cavisson systems

20 Parameterizing Login Page in hpd.c file ns_web_url ("Login",
"URL= {session_demo}", "HEADER=Content-Type: application/x-www-form-urlencoded{session_demo}", "HEADER=Accept-Language: Z{session_demo}", contt.. cavisson systems

21 INLINE_URLS, "URL=http://192. 168. 1
INLINE_URLS, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE ); cavisson systems

22 Accept-Encoding: gzip, deflate, compress;q=0.9^M Keep-Alive: 300^M
Now look at request . It will look something like follows:( Value substituted by NetStorm is shown in bolds) GET /cgi-bin/login?userSession= DQADHfApHDHfcDtccpfAttcf&username=password=JSFormSubmit=off&login.x=0&login.y=0? %22Uxf0w HTTP/1.1^M Host: :83^M User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC2; .NET CLR ; .NET CLR ; .NET CLR ; Media Center PC 6.0; InfoPath.2; .NET4.0C)^MAccept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,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 Content-Type: application/x-www-form-urlencoded "Uxf0w^M Accept-Language: ^RZ "Uxf0w^M ^M cavisson systems

23 Unique No. generated is the same at all the places as we have used “session”
cavisson systems

24 Ex:Update Values On ‘Use’
cavisson systems

25 Parameterizing Login Page in hpd
Parameterizing Login Page in hpd.c file ns_web_url ("Login", "URL= {use_demo}", "HEADER=Content-Type: application/x-www-form-urlencoded{use_demo}", "HEADER=Accept-Language: Z{use_demo}", contt.. cavisson systems

26 INLINE_URLS, "URL=http://192. 168. 1
INLINE_URLS, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE, "URL= "HEADER=Accept-Language: Z", END_INLINE ); cavisson systems

27 Now look at request . It will look something like follows:( Value substituted by NetStorm is shown in bolds) GET /cgi-bin/login?userSession= DQADHfApHDHfcDtccpfAttcf&username={username}password={password}JSFormSubmit=off&login.x=0&login.y=0? Uxy HTTP/1.1^M Host: :83^M User-Agent: Mozilla_CA/4.79 [en] (X11; U; Linux d_epoll i686)^MAccept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,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 Content-Type: application/x-www-form-urlencoded ^M Accept-Language: ^RZ ^M ^M cavisson systems

28 Unique no. generated is different at all places as we have used ‘use’.
Also we can see here that each time new no. is incremented by 1 cavisson systems


Download ppt "Unique Number Parameter"

Similar presentations


Ads by Google