loadrunner录制ftp协议脚本

上一篇 / 下一篇  2013-03-14 22:37:41 / 个人分类:Loadrunner

qKyzg0FTP协议是一种低级协议,用来模拟用户在ftp服务器上的动作,比如登陆、传输文件,断开连接等操作51Testing软件测试网AC'j&pw
可以通过录制FTP会话或手动输入ftp函数来生成脚本
D"L_+R]*[q0步骤:
,W&G.r,W}%v+~k01.打开vuser,新建,目录选择E-business,选择ftp协议,51Testing软件测试网8D%?k2n P a R'~E,K
2.弹出的录制选项,选择ie或win32应用(ftp客户端)51Testing软件测试网,z J g6s-Xjl0e
3.ftp操作,完成录制,生成脚本51Testing软件测试网8tK [ rK7o2HsiA
常用函数:51Testing软件测试网TyyW&T`
*ftp_login
)q"[8f3s0_X0登陆ftp
m6[iN~Mo.|R0语法:init ftp_logon(char *transaction,char *url [attributes,]LAST);
Orf^:L-a2?0示例:ftp_logon(“FTPlogon”,"URL=ftp://test1:123456@servaername:port",LAST);
`0l;Jh*C!C@O(N0如果匿名用户则为anoymous,端口号可省略

{C#T~B.]r#I4Es0

0@o*e G v%@%hg8Sv0*ftp_logout:注销ftp连接51Testing软件测试网s` | bi(L v#Q
语法:int ftp_logout()51Testing软件测试网#VV'v.wr
示例:ftp_logou();

%j1vgY1A)xu mX:v z051Testing软件测试网0i }2\;EoQ Gr`

*ftp_Logon_ex 通过指定的会话登陆ftp
+e)U!q*Po:sTzz9]0语法:int ftp_logon_ex(FTP *ppftp,char *transaction,char *url,[attributes,] LAST);
8C0M\,h;}5y6q4R#i4V0示例:ftp1=0;
`^[.d!Q:[E.F0ftp_logon_ex(&ftp1,"ftplogon","url=URL=ftp://test1:123456@servaername",last)51Testing软件测试网A8k){{&UEa2G0h

51Testing软件测试网:A!i*Qy*LU)\ C4?

*ftp_put将文件上传ftp服务器51Testing软件测试网`%u9D)F6|%}8[
语法:int ftp_put(char *transaction,<item list>LAST);51Testing软件测试网R9C;gH4U^)`o+O
示例:ftp_put("ftp_put",“source_path=ftpfile_1.dat”,"target_path=temp/test.txt",LATS);51Testing软件测试网1F2S#{`"x|

51Testing软件测试网4p8^D#_3S+xESv

*ftp_get从ftp服务器获取文件
3x/|`2o%T4_:Hi*zIr T0语法:int ftp_get(char *transaction,<item list>LAST);
J/EKZZa0q0示例:ftp_get("ftp_get",“source_path=/home/test.txt”,"target_path=d:/test.txt","PASSIVE=TRUE",ENDITEM,LATS);51Testing软件测试网/n3n.TY$qfg

|$F4Ai,?3x0fM&P0*ftp_dir 指定目录执行dir命令
#[$M.{s#I0语法:int ftp_dir(char *transaction,<item list>LAST);
+Vs2A$z w;_&j0示例:ftp_dir("ftp_dir",“path=pub/test”LAST);51Testing软件测试网B'WY&Ju){(D-b}K;Rm
 显示test目录下的文件和子目录51Testing软件测试网;W W k/aD/yc

K-G9\ DZ0*ftp_delete:删除ftp文件51Testing软件测试网Q:kW8@}
*ftp_rendir:重命名文件51Testing软件测试网#]-P4rM&}o
*ftp_rmdir:删除文件夹51Testing软件测试网)OD^/Ib iWP1o/[
*ftp_mkdir:建立文件夹51Testing软件测试网:N(@ aAbB

`.PJ{M:x`U d0
+V7x.HC\0 

"p V5MDAjp0

TAG:

 

评分:0

我来说两句

Open Toolbar