Load Testing Web Sites
by Nicholas Baran

Example 1: 

Visit http://www.cnn.com
Click on the following links below.

world
us
sports
http://www.cnn.com
Technology
Space
Health
Entertainment
Politics
Law
Career
Travel
Food
Arts & Style
Books
Nature
Local
MainPage
Weather
Enter zip
click on Forecast picture (bottom right corner)
MainPage
 

Example 2: 

Click on Jeans
Click on Boot Fit Jeans
Click Add Item to Cart
Choose quantity and click on Add Item to Cart.
Click on Shirts and Polo
Click on Button-Down Polo Shirt
Click Add Item to Cart
Choose quantity and click on Add Item to Cart.
Click on Sign in
Enter a valid email address, password and click on Submit button.
Click on Continue
Enter Credit Card (MasterCard) Number


Listing One
Below is the actual recorded script from www.cnn.com using LoadRunner
#include "as_web.h"
CNN()
{
    web_add_cookie("CNNid=Gcf1947e6-2991-974131075-3; DOMAIN=www.cnn.com");
    web_add_cookie("EditionPopUp=seen(sh:1&id:0); DOMAIN=www.cnn.com");
    web_add_cookie("CNNinPoll=1304821; DOMAIN=www.cnn.com");
    web_url("www.cnn.com",
        "URL=http://www.cnn.com/",
        "Resource=0",
        "RecContentType=text/html",
        "Snapshot=t1.inf",
        LAST);
    web_link("WORLD",
        "Text=WORLD",
        "Ordinal=1",
        "Snapshot=t2.inf",
        LAST);
    lr_think_time( 3 );
    web_link("U.S.",
        "Text=U.S.",
        "Ordinal=1",
        "Snapshot=t3.inf",
        LAST);
    web_add_cookie("CNNid=Gcf1947e6-2991-974131075-3; 
                                     DOMAIN=sportsillustrated.cnn.com");
    web_add_cookie("EditionPopUp=seen(sh:1&id:0); 
                                     DOMAIN=sportsillustrated.cnn.com");
    web_add_cookie("CNNinPoll=1304821; DOMAIN=sportsillustrated.cnn.com");
    lr_think_time( 11 );
    web_link("(MORE)",
        "Text=(MORE)",
        "Ordinal=2",
        "Snapshot=t4.inf",
        LAST);
    lr_think_time( 3 );
    web_url("www.cnn.com",
        "URL=http://www.cnn.com/",
        "Resource=0",
        "RecContentType=text/html",
        "Snapshot=t5.inf",
        LAST);
    web_link("SPACE",
        "Text=SPACE",
        "Ordinal=1",
        "Snapshot=t6.inf",
       LAST);
    lr_think_time( 9 );
    web_link("HEALTH",
        "Text=HEALTH",
        "Ordinal=1",
        "Snapshot=t7.inf",
        LAST);
    web_link("ENTERTAINMENT",
        "Text=ENTERTAINMENT",
        "Ordinal=1",
        "Snapshot=t8.inf",
        LAST);
    web_link("POLITICS",
        "Text=POLITICS",
        "Ordinal=1",
        "Snapshot=t9.inf",
        LAST);
    web_link("LAW",
        "Text=LAW",
        "Ordinal=1",
        "Snapshot=t10.inf",
        LAST);
    web_url("calendar.html",
        "URL=http://www.cnn.com/LAW/trials.and.
                          cases/court.docket/2000/11/calendar.html",
        "TargetFrame=",
        "Resource=0",
        "RecContentType=text/html",
        "Snapshot=t11.inf",
        LAST);
    web_url("20.html",
        "URL=http://www.cnn.com/LAW/trials.and.
                         cases/court.docket/2000/11/20.html",
        "TargetFrame=",
        "Resource=0",
        "RecContentType=text/html",
        "Snapshot=t12.inf",
        LAST);
    lr_think_time( 8 );
    web_url("CAREER",
        "URL=http://www.cnn.com/CAREER/",
        "TargetFrame=",
        "Resource=0",
        "RecContentType=text/html",
        "Snapshot=t13.inf",
        LAST);
    web_link("TRAVEL",
       "Text=TRAVEL",
        "Ordinal=1",
        "Snapshot=t14.inf",
        LAST);
    web_link("FOOD",
        "Text=FOOD",
        "Ordinal=1",
        "Snapshot=t15.inf",
        LAST);
    web_link("ARTS & STYLE",
        "Text=ARTS & STYLE",
        "Ordinal=1",
        "Snapshot=t16.inf",
        LAST);
    web_link("BOOKS",
        "Text=BOOKS",
        "Snapshot=t17.inf",
        LAST);
    web_link("NATURE",
        "Text=NATURE",
        "Snapshot=t18.inf",
        LAST);
    web_link("LOCAL",
        "Text=LOCAL",
        "Snapshot=t19.inf",
        LAST);
    web_link("WEATHER",
        "Text=WEATHER",
        "Ordinal=2",
        "Snapshot=t20.inf",
        LAST);
    web_submit_form("redirect",
        "Ordinal=5",
        "Snapshot=t21.inf",
        ITEMDATA,
        "name=zip",
        "value=19116",
        ENDITEM,
        LAST);
    return 0;
}

Listing Two:
//----------------------------------------------------------------------
// Recorded 11/13/2000 by SilkPerformer Recorder v4.0.0.803
//----------------------------------------------------------------------
benchmark SilkPerformerRecorder
use "WebAPI.bdh"
dcluser
  user
    VUser
  transactions
    TInit           : begin;
    TMain           : 1;
var
dclrand
dcltrans
  transaction TInit
  begin
    //WebSetBrowser(WEB_BROWSER_MSIE55);
    //WebSetUserBehavior(WEB_USERBEHAVIOR_FIRST_TIME);
    //WebSetDocumentCache(true, WEB_CACHE_CHECK_SESSION);
  end TInit;
  transaction TMain
  var
    hContext1 : number;
  begin 
    //WebCookieSet(
      //
      //"CNNid=cf301322-26889-974130557-1; expires=Wednesday, 
      //                        30-Dec-2037 16:00:00 GMT; path=/; d"
      //"omain=.cnn.com", "http://www.cnn.com/");
    WebPageAddUrl("http://a388.g.akamai.net/f/388/21/15m/www.cnn.com/
                                             virtual/2000/code/main.js")
      ;
    WebPageAddUrl(
      "http://a388.g.akamai.net/f/388/21/15m/www.cnn.com/
                                             virtual/2000/style/main.css");
    WebPageAddUrl(
      "http://a388.g.akamai.net/f/388/21/2d/www.cnn.com/ELECTION/2000/
                                             virtual/style/elect1.css")
      ;
    // Redirecting to http://www.cnn.com/images/icons/audio.gif
    WebCookieSet(
      "CNNid=cf301322-26889-974130557-1; path=/; 
                         domain=.com; expires=Sat, 13 Nov 2010 15:46:54"
      " GMT", "http://cnn.com/");
    // Redirecting to 
    // http://www.cnnaudience.com/
    //       cookie.crumb?cookie=cf301322-26889-974130557-1&origin=cnn&serv
    // er=www.cnn.com
    //WebCookieSet(
      //
      //"AUDid=cf1947e6-3020-974130577-10; expires=Wednesday, 
      //                           30-Dec-2037 16:00:00 GMT; path=/; d"
      //"omain=.cnnaudience.com", "http://www.cnnaudience.com/");
    // Redirecting to http://www.cnn.com/images/time/1101001120cnn.gif
    WebPageUrl("http://www.cnn.com/", "CNN.com");
    WebCookieSet(
      "UID=2|2855858083|20201111; path=/; domain=.bfast.com; 
                                   expires=Sat, 13 Nov 2010 15:46:57 "
      "GMT", "http://service.bfast.com/");
    WebCookieSet(
      "DRJ=1|2855858083|35334469|33331699|33893015|0|8635926; 
                                    path=/; domain=.bfast.com; expire"
      "s=Sat, 13 Nov 2010 15:46:57 GMT", "http://service.bfast.com/");
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/world.css");
    // Redirecting to 
    // http://www.cnnaudience.com/cookie.crumb?
    //              cookie=cf301322-26889-974130557-1&origin=cnn&serv
    // er=www.cnn.com
    //WebCookieSet(
      //
      //"AUDid=cf1947e6-2988-974130592-7; expires=Wednesday, 
      //                        30-Dec-2037 16:00:00 GMT; path=/; do"
      //"main=.cnnaudience.com", "http://www.cnnaudience.com/");
    WebPageLink("WORLD", "CNN.com - World News"); // link: 16

    ThinkTime(2.4);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/us.css");
    WebPageLink("U.S.", "CNN.com - US News"); // link: 45
 
    ThinkTime(8.1);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/weather.css");
    WebPageAddUrl("http://www.cnn.com/virtual/weather/vector.js");
    WebCookieSet(
      "id=80000003a08a389; path=/; domain=.doubleclick.net; 
                                   expires=Sat, 13 Nov 2010 15:47:40 G"
      "MT", "http://ad.doubleclick.net/");
    // Redirecting to http://m.doubleclick.net/viewad/393189-cubanner_05.gif
    WebPageLink("WEATHER", "CNN.com - Weather Main Page", 2); // link: 59
    WebPageStoreContext(hContext1);
    // Redirecting to http://sportsillustrated.cnn.com/

    ThinkTime(9.0);
    WebPageAddUrl(
      "http://a1208.g.akamai.net/7/1208/380/1d/sportsillustrated.cnn.com/
                                                    images/components/navo"
      "therbutton.gif");
    WebPageAddUrl("http://sportsillustrated.cnn.com/
                                  your_turn/you_said_it/front_quotes.js");
    // Redirecting to 
    // http://sportsillustrated.cnn.com/
    //                  images/ads/swimsuit/2000/0222/Final_120x60.gif
    // Redirecting to 
    // http://sportsillustrated.cnn.com/
    //                  images/ads/cnnsi/2000/0214/nav_magazine3.gif
    // Redirecting to 
    // http://sportsillustrated.cnn.com/
    //                  cookie.crumb?audid=Gcf1947e6-2988-974130592-7
    // Redirecting to 
    // http://sportsillustrated.cnn.com/
    //                  cookie.crumb?audid=Gcf1947e6-2988-974130592-7
    //WebCookieSet(
      //
      //"CNNid=Gcf1947e6-2988-974130592-7; domain=.cnn.com; path=/; 
      //                                expires=Fri 13-Aug-2010 02:12"
      //":00 GMT;", "http://sportsillustrated.cnn.com/");
    WebPageLink("(MORE)", "CNNSI.com from CNN and Sports Illustrated", 2); 
                                                               // link: 34
    ThinkTime(23.7);
    WebUrl(
      "http://a1204.g.akamai.net/f/1204/1181/24h/www.affiliate.net/
                                          affnet/images/book_topA.gif",
       0.13);
    WebUrl(
      "http://a1204.g.akamai.net/f/1204/1181/24h/www.affiliate.net/
                                          affnet/images/blue_go.gif", 
      0.16);
    // Redirecting to http://www.cnn.com/images/time/1101001120cnn.gif
    WebUrl("http://cnn.com/images/time/1101001120cnn.gif", 0.06);
    WebCookieSet(
      "CNNid=Gcf1947e6-2988-974130592-7; path=/; domain=.com; 
                                      expires=Sat, 13 Nov 2010 15:48:17"
      " GMT", "http://cnn.com/");
    WebUrl("http://www.cnn.com/cookie.crumb", 0.34);
    WebCookieSet(
      "CNNid=Gcf1947e6-2988-974130592-7; path=/; domain=.com; 
                                       expires=Sat, 13 Nov 2010 15:48:17"
      " GMT", "http://cnn.com/");

    ThinkTime(2.1);
    WebPageBack();
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/tech.css");
    WebPageAddUrl("http://ads.enliven.com/nc/rd", NC_RD001);
    // Redirecting to 
    // http://ads.enliven.com/tools/igen.dll?session=256410158;
    //                               euid=0;type=script;cid=102016;sid
    // =300;click=
    //WebCookieSet("euid=0;expires=Thursday, 01-Jan-2030 00:00:00 GMT;path=/", 
      //"http://ads.enliven.com/");
    // Redirecting to 
    // http://ads.enliven.com/tools/igen.dll?session=239663534;
    //                               euid=545449926;type=iframe;cid=10
    // 2016;sid=300;click=
    //WebCookieSet("euid=545449926;expires=Thursday, 
    //                         01-Jan-2030 00:00:00 GMT;path=/", 
    //                         "http://ads.enliven.com/");
    // Redirecting to http://ads.enliven.com/
    //                content/102000/16/creative/shopping_468x6012k3.gif
    WebPageLink("TECHNOLOGY", "CNN.com - Technology"); // link: 46

    ThinkTime(3.4);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/space.css");
    //WebCookieSet(
      //
      //"uid=0xd3c5d356d.0xcf08e9db; expires=Mon, 31-Dec-2029 23:59:59 GMT; 
      //                                       path=/; domain=ads.li"
      //"nk4ads.com", "http://van.ads.link4ads.com/");

    // Redirecting to 
    // http://ads.fp.sandpiper.net/was.ms.link4ads.com/
    //                            creatives/creatives1/22/35/79/0-37.gif
    WebPageAddUrl("http://www.cnn.com/TECH/virtual/space/1999/
                                                     countdown.alt.js");
    WebPageLink("SPACE", "CNN - Technology: Space"); // link: 64
 
    ThinkTime(9.3);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/health.css");
    WebCookieSet(
      "CNNid=Gcf1947e6-2988-974130592-7; path=/; domain=.com; 
                                         expires=Sat, 13 Nov 2010 15:48:46"
      " GMT", "http://cnn.com/");
    // Redirecting to http://m.doubleclick.net/
    //                             viewad/317166-0mbth068_pixel.gif
    // Redirecting to http://www.cnn.com/HEALTH/
    //                             condition.clinic/images/webmd.box.gif
    WebPageLink("HEALTH", "CNN.com - Health"); // link: 48

    ThinkTime(6.6);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/entertainment.css");
    WebPageLink("ENTERTAINMENT", "CNN.com - Entertainment Main Page"); 
                                                          // link: 58

    ThinkTime(9.5);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/allpolitics.css");
    // Redirecting to http://m.doubleclick.net/
    //                                  viewad/201365-now_refreshaiabaa.gif
    WebPageLink("POLITICS", "CNN/AllPolitics"); // link: 41

    ThinkTime(7.6);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/law.css");
    WebPageAddUrl("http://www.cnn.com/virtual/2000/law/code/law.js");
    WebPageAddUrl("http://www.cnn.com/LAW/images/top_nav/tcOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/top_nav/ofOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/top_nav/llOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/janOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/febOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/marOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/marOff.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/aprOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/mayOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/junOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/julOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/augOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/sepOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/octOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/novOn.gif");
    WebPageAddUrl("http://www.cnn.com/LAW/images/
                                court.docket/months.main/decOn.gif");
    WebPageLink("LAW", "CNN.com - LAW Center"); // link: 41
    WebPageAddUrl("http://www.cnn.com/virtual/2000/code/main.js");
    WebPageAddUrl("http://www.cnn.com/CAREER/drag_it.js");
    // Redirecting to http://m.doubleclick.net/
    //                   viewad/491636-am_ban_trvl_x2_x_468x60_3.gif
    WebPageAddUrl("http://www.cnn.com/CAREER/images/arrow_orange.gif");
    WebPageLink("CAREER", "CNN.com - Career"); // link: 75
    WebPageUrl("http://www.cnn.com/CAREER/careercenter/
                                  careerNextCareer.html", "Untitled");
    WebPageBack();
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/travel.css");
    WebPageLink("TRAVEL", "CNN.com - TravelGuide"); // link: 53
 
    ThinkTime(11.2);
    WebPageAddUrl("http://www.cnn.com/virtual/1998/code/cnn.js");
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/main.css");
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/food.css");
    // Redirecting to http://www.cnn.com/images/hub2000/ad.info.gif
    WebPageLink("FOOD", "CNN.com Food Central"); // link: 52
 
    ThinkTime(5.8);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/style.css");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/fashion_on.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/design_on.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/art_on.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/onair_on.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/resources_on.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/fashion_over.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/design_over.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/art_over.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/onair_over.gif");
    WebPageAddUrl("http://www.cnn.com/images/1999/10/resources_over.gif");
    WebPageLink("ARTS &STYLE", "CNN.com - arts &? style"); // link: 54
 
    ThinkTime(2.8);
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/nature.css");
    // Redirecting to http://ad.doubleclick.net/
    //                    viewad/504243/begin_mp3_468_1.gif
    // Redirecting to http://ad.doubleclick.net/
    //                    viewad/504243/begin_mp3_468_1.gif
    WebPageLink("NATURE", "CNN.com - Nature"); // link: 73
 
    ThinkTime(12.8);
    WebPageAddUrl("http://www.cnn.com/virtual/1998/code/cnn.css");
    WebPageLink("LOCAL", "CNN - Your Local Link"); // link: 78
    // Redirecting to http://m.doubleclick.net/viewad/393189-cubanner_05.gif
    WebUrl("http://ad.doubleclick.net/ad/N828.cnn/B18341;
                                sz=468x60;ord=2000.11.13.15.50.19.0", 
      5.25);
    // form found in stored context
    // Redirecting to http://www.cnn.com/WEATHER/ne/PA/TrevosePATV.html
    WebPageAddUrl("http://www.cnn.com/virtual/2000/code/main.js");
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/main.css");
    WebPageAddUrl("http://www.cnn.com/virtual/2000/style/weather.css");
    WebPageAddUrl("http://www.cnn.com/virtual/weather/vector.js");
    WebPageSubmit("go", FORM002, "CNN.com - Weather - Trevose, PA"); 
                                                           // form: 5
 
    WebPageDeleteContext(hContext1);
    WebCookieSet(
      "CNNid=Gcf1947e6-2988-974130592-7; path=/; 
                         domain=.com; expires=Sat, 13 Nov 2010 15:51:11"
      " GMT", "http://cnn.com/");
    WebPageLink("CNN.com", "CNN.com"); // link: 7
 
    ThinkTime(6.4);
    WebPageBack();
    WebCookieSet(
      "CNNid=Gcf1947e6-2988-974130592-7; path=/; domain=.com; 
                                     expires=Sat, 13 Nov 2010 15:51:24"
      " GMT", "http://cnn.com/");
    WebPageLink("thumbnail map", "CNN - Weather Forecast for 
                                             North America - Today", 4);
      // link: 145
  end TMain;
dclform
  NC_RD001:
    "type"                    := "script;cid=102016;sid=300;click=";
  FORM002:
    //"zip"                     := "19116";
      "zip"                     := "C:\Program Files\Segue\
                                    SilkPerformer 4.0\Working\Data\zip.txt";




9

