Random Number Parameter 10/19/2011 cavisson system
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
Random Number Parameter Window 10/19/2011 cavisson system
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
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
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
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
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
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 00003 if format is ‘%05lu’ 10/19/2011 cavisson system
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
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
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
1.In registration.spec file, right-click in right pane and choose Parameters > Random Number Parameter 10/19/2011 cavisson system
3.Set following values:- 2.Click on ADD button 3.Set following values:- 10/19/2011 cavisson system
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
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=http://192.168.1.39:83/cgi-bin/findflight?firstName=Tiger&lastName=Scott&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%7C09-17-2011&advanceDiscount=&.cgifields=saveCC&buyFlights.x=43&buyFlights.y=12", "HEADER=Accept-Language: Z", contt.. 10/19/2011 cavisson system
INLINE_URLS, "URL=http://192. 168. 1 INLINE_URLS, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/banner_animated.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/sun_swede.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/flights.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/home.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/signoff.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/images/splash_flightconfirm.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/images/bookanother.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/vep/images/velocigen.gif", "HEADER=Accept-Language: Z", END_INLINE ); 10/19/2011 cavisson system
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=000000008&expDate=12%2F2%2F&oldCCOption=&numPassengers=1&seatType=Coach&seatPref=None&outboundFlight=000%7C0%7C09-17-2011&advanceDiscount=&.cgifields=saveCC&buyFlights.x=43&buyFlights.y=12 HTTP/1.1^M 10/19/2011 cavisson system
Accept-Encoding: gzip, deflate, compress;q=0.9^M Keep-Alive: 300^M Host: 192.168.1.39:83^MUser-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.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)^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
Ex : Update Value On ‘Session 10/19/2011 cavisson system
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
INLINE_URLS, "URL=http://192. 168. 1 INLINE_URLS, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/banner_animated.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/sun_swede.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/flights.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/home.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/signoff.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/images/banner_merctur.jpg", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/vep/images/velocigen.gif", "HEADER=Accept-Language: Z", END_INLINE ); 10/19/2011 cavisson system
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=75893.0884568651DQADHfApHDHfcDtccpfAttcf&username=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0?000000012 HTTP/1.1^M Host: 192.168.1.39:83^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)^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-urlencoded000000012^M Accept-Language: ^RZ000000012^M ^M 10/19/2011 cavisson system
Random number generated is the same at all the places as we have used “session” 10/19/2011 cavisson system
Ex:Update Values On ‘Use’ 10/19/2011 cavisson system
Parameterizing Login Page in hpd.c file ns_web_url ("Login", "URL=http://192.168.1.39:83/cgi-bin/login?userSession=75893.0884568651DQADHfApHDHfcDtccpfAttcf&username=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0?{Use_Demo}", "HEADER=Content-Type: application/x-www-form-urlencoded{Use_Demo}", "HEADER=Accept-Language: Z{Use_Demo}", 10/19/2011 cavisson system
INLINE_URLS, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/banner_animated.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/sun_swede.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/flights.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/home.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/signoff.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/images/banner_merctur.jpg", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/vep/images/velocigen.gif", "HEADER=Accept-Language: Z", END_INLINE ); 10/19/2011 cavisson system
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=75893.0884568651DQADHfApHDHfcDtccpfAttcf&username=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0?000000008 HTTP/1.1^M Host: 192.168.1.39:83^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)^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-urlencoded000000011^M Accept-Language: ^RZ000000009^M ^M 10/19/2011 cavisson system
Random Number generated is different at all places as we have used ‘use’. 10/19/2011 cavisson system
Example heading????? 10/19/2011 cavisson system
Parameterizing Login Page in hpd Parameterizing Login Page in hpd.c file ns_web_url ("Login", "URL=http://192.168.1.39:83/cgi-bin/login?userSession=75893.0884568651DQADHfApHDHfcDtccpfAttcf&username=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0?{large_value_demo}", "HEADER=Content-Type: application/x-www-form-urlencoded{large_value_demo}", "HEADER=Accept-Language: Z{large_value_demo}", 10/19/2011 cavisson system
INLINE_URLS, "URL=http://192. 168. 1 INLINE_URLS, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/banner_animated.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/sun_swede.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/flights.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/home.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/Merc10-dev/images/signoff.gif", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/images/banner_merctur.jpg", "HEADER=Accept-Language: Z", END_INLINE, "URL=http://192.168.1.39:83/tours/vep/images/velocigen.gif", "HEADER=Accept-Language: Z", END_INLINE ); 10/19/2011 cavisson system
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=75893.0884568651DQADHfApHDHfcDtccpfAttcf&username=sanjinipassword=vishnoiJSFormSubmit=off&login.x=0&login.y=0?001776981 HTTP/1.1^M Host: 192.168.1.39:83^M User-Agent: Mozilla/5.0 [en] (X11; U; Linux 2.4.18-3d_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-urlencoded006702459^M Accept-Language: ^RZ003593100^M ^M 10/19/2011 cavisson system