Download presentation
Presentation is loading. Please wait.
1
Random Number Parameter
10/19/2011 cavisson system
2
The length of the formed number will be in a specified range
Random Number Parameter is used to generate a random number of characters whose length is also random but lies within a specified range. The length of the formed number will be in a specified range 10/19/2011 cavisson system
3
Random Number Parameter Window
10/19/2011 cavisson system
4
1.Parameter Name Defining various fields of this parameter.
‘Parameter name’ is a ‘random number 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). 10/19/2011 cavisson system
5
2.Minimum Here you can specify the minimum number below which random number should not be generated. It can range from 0-10,000. 10/19/2011 cavisson system
6
3.Maximum Here you can specify maximum number above which random number should not be generated. It can range from 0-1,000,000 10/19/2011 cavisson system
7
4.Format If you want to specify length of the number generated, you can specify it here. It can have following values:- %01lu %02lu %03lu %04lu %05lu %06lu %07lu %08lu %09lu contt… 10/19/2011 cavisson system
8
The number in this format indicates minimum length of the number generated.
If the length of the number generated is less than the specified length, then it is left padded with zeros. 10/19/2011 cavisson system
9
Here we have given Min = 2; Max = 5; and Format = %02lu.
If NetStorm generates random number 3, then it will save 03 in random number as format given is ‘%02lu’. Similarly saved no will be if format is ‘%05lu’ 10/19/2011 cavisson system
10
5.Update Value On This field is used to tell Netstorm when to generate new string: It has two options:- Session use contt.. 10/19/2011 cavisson system
11
Means generate string once and use this value for the entire session.
i.e. If ‘session’ is chosen, random string is generated only for first use of Random string Parameter. Then for the entire script, same value is used. Use:: Means generate string every time Random String Parameter is used. i.e. If ‘Use’ is chosen, random string is generated for each use of Random String Parameter. For example::If Random String Parameter is used 50 times in script, then in case of ‘use’, for every reference, new random string is generated. 10/19/2011 cavisson system
12
Example:: In this example, we will generate a Random Number for Credit Card number and parameterize it on Confirmation Page. 10/19/2011 cavisson system
13
1.In registration.spec file, right-click in right pane and choose Parameters > Random Number Parameter 10/19/2011 cavisson system
14
3.Set following values:-
2.Click on ADD button 3.Set following values:- 10/19/2011 cavisson system
15
4.Click on OK > Close. You will notice following API is inserted in registration.spec file:-
nsl_random_number_var(CreditCard, Min=8, Max=12, Format=%09lu, Refresh=SESSION); 10/19/2011 cavisson system
16
After Parameterization, Confirmation Page looks like as shown below:-
5.Click on SAVE button and open hpd.c, Parameterize Credit Card number available on Confirmation Page. After Parameterization, Confirmation Page looks like as shown below:- ns_web_url ("Confirmation", "URL= "HEADER=Accept-Language: Z", contt.. 10/19/2011 cavisson system
17
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, "URL= "HEADER=Accept-Language: Z", END_INLINE ); 10/19/2011 cavisson system
18
6. Click on Save button and execute scenario. 7
6.Click on Save button and execute scenario. 7. Now look at request with number 5. It will look something like follows:( Value substituted by NetStorm is shown in bolds) 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=43&buyFlights.y=12 HTTP/1.1^M 10/19/2011 cavisson system
19
Accept-Encoding: gzip, deflate, compress;q=0.9^M Keep-Alive: 300^M
Host: :83^MUser-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.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 Accept-Language: ^RZ^M ^M 10/19/2011 cavisson system
20
Ex : Update Value On ‘Session
10/19/2011 cavisson system
21
Parameterizing Login Page in hpd.c file ns_web_url ("Login",
"HEADER=Content-Type: application/x-www-form-urlencoded{Session_Demo}", "HEADER=Accept-Language: Z{Session_Demo}", 10/19/2011 cavisson system
22
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 ); 10/19/2011 cavisson system
23
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=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0? 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 ^M Accept-Language: ^RZ ^M ^M 10/19/2011 cavisson system
24
Random number generated is the same at all the places as we have used “session”
10/19/2011 cavisson system
25
Ex:Update Values On ‘Use’
10/19/2011 cavisson system
26
Parameterizing Login Page in hpd.c file
ns_web_url ("Login", "URL= "HEADER=Content-Type: application/x-www-form-urlencoded{Use_Demo}", "HEADER=Accept-Language: Z{Use_Demo}", 10/19/2011 cavisson system
27
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 ); 10/19/2011 cavisson system
28
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=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0? 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 ^M Accept-Language: ^RZ ^M ^M 10/19/2011 cavisson system
29
Random Number generated is different at all places as we have used ‘use’.
10/19/2011 cavisson system
30
Example heading????? 10/19/2011 cavisson system
31
Parameterizing Login Page in hpd
Parameterizing Login Page in hpd.c file ns_web_url ("Login", "URL= "HEADER=Content-Type: application/x-www-form-urlencoded{large_value_demo}", "HEADER=Accept-Language: Z{large_value_demo}", 10/19/2011 cavisson system
32
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 ); 10/19/2011 cavisson system
33
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=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0? HTTP/1.1^M Host: :83^M User-Agent: Mozilla/5.0 [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 10/19/2011 cavisson system
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.