|
sdlkfj9 sdlkfj9 sdlkfj9 sdlkfj9
脚本代码如下:
#include "web_api.h"
Action()
{
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 5
// {CSRule_1_UID4} = "11764441269719256"
// */
web_reg_save_param("CSRule_1_UID4",
"LB= value=\"",
"RB=\"",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);
/* Registering parameter(s) from source task id 5
// {CSRule_1_UID5} = "LT-29-oQvYuROFulSI1smhXcJR"
// */
web_reg_save_param("CSRule_1_UID5",
"LB= value=\"",
"RB=\"",
"Ord=2",
"Search=Body",
"RelFrameId=1",
LAST);
web_url("scm",
"URL=http://192.168.1.9:8080/scm",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time( 28 );
lr_rendezvous("loggingin");/*
* start logging in
*/
lr_think_time( 3 );
lr_start_transaction("logging in");
lr_think_time( 15 );
lr_think_time( 89 );
web_submit_data("login",
"Action=https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F",
"Method=POST",
"RecContentType=text/html",
"Referer=https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=fileName", "Value={CSRule_1_UID4}", ENDITEM,
"Name=lt", "Value={CSRule_1_UID5}", ENDITEM,
"Name=username", "Value=xsjl$#*@$it01", ENDITEM,
"Name=companyCode", "Value={NewParam1}", ENDITEM,
"Name=uname", "Value={NewParam2}", ENDITEM,
"Name=password", "Value={NewParam3}", ENDITEM,
"Name=validateCode", "Value=16888", ENDITEM,
LAST);
web_url("scm_2",
"URL=http://192.168.1.9:8080/scm/?ticket=ST-28-bEMUPQfiH6ThlqgwHxwF",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
web_url("authentication.action",
"URL=http://192.168.1.9:8080/scm/authentication.action",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=web/DstreeSharedDir/DSTree.htc", "Referer=", ENDITEM,
"Url=web/images/main/ding1.jpg", ENDITEM,
"Url=web/images/main/tu.jpg", ENDITEM,
"Url=web/images/main/ding4.jpg", ENDITEM,
"Url=web/images/main/xiayou.jpg", ENDITEM,
"Url=web/images/main/xiazuo.jpg", ENDITEM,
"Url=web/DstreeSharedDir/DSTree.xsl", ENDITEM,
"Url=web/DstreeSharedDir/contract.gif", ENDITEM,
"Url=web/DstreeSharedDir/open.gif", ENDITEM,
"Url=web/DstreeSharedDir/leaf.gif", ENDITEM,
"Url=web/DstreeSharedDir/page.gif", ENDITEM,
"Url=web/DstreeSharedDir/expand.gif", ENDITEM,
"Url=web/DstreeSharedDir/close.gif", ENDITEM,
LAST);
lr_think_time( 461 );
lr_end_transaction("logging in", LR_AUTO);
return 0;
运行结果代码如下
Virtual User Script started
Starting action vuser_init.
Web Turbo Replay of LoadRunner 8.0.0 for WINXP; Web build 4141 [MsgId: MMSG-27143]
Run-Time Settings file: "C:\Documents and Settings\快乐工作\Local Settings\Temp\noname55\\default.cfg" [MsgId: MMSG-27141]
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(6): web_set_max_html_param_len was successful [MsgId: MMSG-26392]
Action.c(11): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(22): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(30): Redirecting "http://192.168.1.9:8080/scm" (redirection depth=0) [MsgId: MMSG-26694]
Action.c(30): To location "http://192.168.1.9:8080/scm/" [MsgId: MMSG-26693]
Action.c(30): Redirecting "http://192.168.1.9:8080/scm/" (redirection depth=1) [MsgId: MMSG-26694]
Action.c(30): To location "https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F" [MsgId: MMSG-26693]
Action.c(30): Found resource "https://www.seekcall.com:8443/cas/web/pagesStyleSheet.css" in HTML "https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F" [MsgId: MMSG-26659]
Action.c(30): Found resource "https://www.seekcall.com:8443/cas/web/public.js" in HTML "https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F" [MsgId: MMSG-26659]
Action.c(30): Found resource "https://www.seekcall.com:8443/cas/web/images/loginBg.gif" in HTML "https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F" [MsgId: MMSG-26659]
Action.c(30): Found resource "https://www.seekcall.com:8443/cas/web/images/loginWindow.jpg" in HTML "https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F" [MsgId: MMSG-26659]
Action.c(30): Found resource "https://www.seekcall.com:8443/cas/web/picbuild/11764466542565161.jpg" in HTML "https://www.seekcall.com:8443/cas/login?service=http%3A%2F%2F192.168.1.9%3A8080%2Fscm%2F" [MsgId: MMSG-26659]
Action.c(30): web_url("scm") was successful, 56229 body bytes, 1733 header bytes, 5 chunking overhead bytes [MsgId: MMSG-26385]
Action.c(41): Rendezvous loggingin
Action.c(47): Notify: Transaction "logging in" started.
Action.c(53): web_submit_data("login") was successful, 437 body bytes, 263 header bytes [MsgId: MMSG-26386]
Action.c(70): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "http://192.168.1.9:8080/scm/?ticket=ST-28-bEMUPQfiH6ThlqgwHxwF" [MsgId: MERR-26612]
Action.c(70): web_url("scm_2") highest severity level was "ERROR", 1434 body bytes, 182 header bytes [MsgId: MMSG-26388]
Action.c(70): Notify: Transaction "logging in" ended with "Fail" status (Duration: 0.7436 Wasted Time: 0.0000).
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
图如下 |
|