51Testing软件测试论坛

标题: loadrunner中该采用哪种协议? [打印本页]

作者: giantsong    时间: 2004-7-21 16:54
标题: loadrunner中该采用哪种协议?
功能点:通过IE访问一站点,然后从站点下载一个EXCEL格式的文件
用过了:http协议,winsockets协议,web/winsocket dual protocl,结果保存的过程都没能录制下来,请哪位高人指点一下?
作者: pcl2004_27    时间: 2004-7-22 10:24
用winsock是可生成脚本的
    我录制登陆www.baidu.com 下载刘德华的一首歌,脚本如下
   
   /*********************************************************************
* Created by Mercury Interactive Windows Sockets Recorder
*
* Created on: Thu Jul 22 09:59:41
*********************************************************************/

#include "lrs.h"


vuser_init()
{
    lrs_startup(257);

    lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=202.108.249.131:80",  LrsLastArg);

    lrs_send("socket0", "buf0", LrsLastArg);

    lrs_receive("socket0", "buf1", LrsLastArg);

    lrs_close_socket("socket0");

    lrs_create_socket("socket1", "TCP", "LocalHost=0", "RemoteHost=218.1.65.41:80",  LrsLastArg);

    lrs_create_socket("socket2", "TCP", "LocalHost=0", "RemoteHost=219.133.39.11:80",  LrsLastArg);

    lrs_create_socket("socket3", "TCP", "LocalHost=0", "RemoteHost=218.1.65.41:80",  LrsLastArg);

    lrs_send("socket2", "buf2", LrsLastArg);

    lrs_send("socket1", "buf3", LrsLastArg);

    lrs_send("socket3", "buf4", LrsLastArg);

    lrs_receive("socket2", "buf5", LrsLastArg);

    lrs_close_socket("socket2");

    lrs_receive("socket1", "buf6", LrsLastArg);

    lrs_close_socket("socket1");

    lrs_create_socket("socket4", "TCP", "LocalHost=0", "RemoteHost=218.1.65.41:80",  LrsLastArg);

    lrs_receive("socket3", "buf7", LrsLastArg);

    lrs_close_socket("socket3");

    lrs_create_socket("socket5", "TCP", "LocalHost=0", "RemoteHost=218.1.65.41:80",  LrsLastArg);

    lrs_send("socket4", "buf8", LrsLastArg);

    lrs_send("socket5", "buf9", LrsLastArg);

    lrs_receive("socket4", "buf10", LrsLastArg);

    lrs_receive("socket5", "buf11", LrsLastArg);

    lrs_close_socket("socket4");

    lrs_close_socket("socket5");

    lrs_create_socket("socket6", "TCP", "LocalHost=0", "RemoteHost=218.1.65.41:80",  LrsLastArg);

    lrs_create_socket("socket7", "TCP", "LocalHost=0", "RemoteHost=218.1.65.41:80",  LrsLastArg);

    lrs_send("socket6", "buf12", LrsLastArg);

    lrs_send("socket7", "buf13", LrsLastArg);

    lrs_receive("socket6", "buf14", LrsLastArg);

    lrs_receive("socket7", "buf15", LrsLastArg);

    lrs_close_socket("socket6");

    lrs_close_socket("socket7");

    lrs_create_socket("socket8", "TCP", "LocalHost=0", "RemoteHost=218.1.65.41:80",  LrsLastArg);

    lrs_send("socket8", "buf16", LrsLastArg);

    lrs_receive("socket8", "buf17", LrsLastArg);

    lrs_close_socket("socket8");

    lr_think_time(21);

    lrs_create_socket("socket9", "TCP", "LocalHost=0", "RemoteHost=219.150.150.161:80",  LrsLastArg);

    lrs_send("socket9", "buf18", LrsLastArg);

    lrs_receive("socket9", "buf19", LrsLastArg);

    return 0;
}
作者: giantsong    时间: 2004-8-5 10:42
标题: 这个脚本,在不在测试机上存文件?
这个脚本,在不在测试机上存文件?还是只模拟网络传输?
作者: pcl2004_27    时间: 2004-8-5 21:09
本机保存文件!
作者: zsh    时间: 2005-5-6 10:30
标题: LoadRunner脚本使用的是哪种语言
LoadRunner的脚本是否和WinRnnner的脚本一样,全部是类c的?




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2