51Testing软件测试论坛

标题: 如何测试通过socket上传图象 [打印本页]

作者: 我爱土猪    时间: 2006-9-29 16:01
标题: 如何测试通过socket上传图象
我需要测试利用socket上传图象,脚本录制到了如下,但是如果我需要要做参数化处理的时候,需要如何参数话处理啊!也就是需要模拟上传不同大小的图片了
脚本录制如下:
/*********************************************************************
* Created by Mercury Interactive Windows Sockets Recorder
*
* Created on: Fri Sep 29 14:48:21
*********************************************************************/

#include "lrs.h"


Action()
{
    lr_think_time(41);

    lrs_create_socket("socket9", "TCP", "RemoteHost=10.1.100.170:8022",  LrsLastArg);

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

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

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

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

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

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

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

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

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

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

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

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

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

    lr_think_time(6);

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

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

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

    lrs_disable_socket("socket9", DISABLE_SEND_RECV);

    lrs_close_socket("socket9");

    lrs_create_socket("socket10", "TCP", "LocalHost=0", "RemoteHost=NANTIANE-K5C4EN:808",  LrsLastArg);

    lrs_send("socket10", "buf244", LrsLastArg);

    lrs_receive("socket10", "buf245", LrsLastArg);

    lrs_close_socket("socket10");

    lrs_create_socket("socket11", "TCP", "LocalHost=0", "RemoteHost=NANTIANE-K5C4EN:808",  LrsLastArg);

    lrs_send("socket11", "buf246", LrsLastArg);

    lrs_receive("socket11", "buf247", LrsLastArg);

    lrs_close_socket("socket11");

    return 0;
}
作者: jackloo    时间: 2006-9-30 13:35
麻烦着呢,但也有方法可做,我以前也有这样的做法,开了个头就做不下去了。
找到你那些buf文件,里面是二进制内容,用ultraedit打开,然后找到你录制时上传的图片,也用ultraedit打开,2者比较,找到这个图片在buf中的地址,然后把这部分内容做参数化,所有的参数值全部用二进制方式表示。




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