51Testing软件测试论坛

标题: 求助.LR场景设计和录制脚本 [打印本页]

作者: jiaruiqiang    时间: 2011-8-22 15:14
标题: 求助.LR场景设计和录制脚本
C/S结构,服务器端是java,客户端是.net,数据库oracle10

软件功能我大概说下,  用软件设计一个画面,画面包括若干个控件,控件类型如:饼图、柱图、曲线图等。 而这些控件上绑定的是数据,数据从oracle数据来取。

我想要录制的操作:
1.打开客户端,选择一个服务器(没用户登陆),配置好的,直接点击 进入 就进行了系统.

2.新建一个画面,添加控件,并绑定数据,然后保存,点击预览, 控件数据完全显示后,退出预览,退出系统。

3.或者是录制一个已有的画面(目前正在测的),具体是:进入系统后,直接打开做好的画面,进行预览,数据完全显示后,退出预览,退出系统。脚本录制结束。

3的脚本已经录制完成,脚本回放没有报错。我现在想实现,对录好的脚本 按时间运行后不停的迭代,但是现在无法实现,运行要不就报错,要不就是 通过的事务为0, 还请各位高手给予指导,这样的需求我应该怎么样来录制脚本设计场景。

另外一个问题,我在录制的时候在启动客户端进入系统时,选择的是录到vuser_init,进入系统后的其他操作放到Action里,但是录制结束后看到的vuser_init里没有任何内容。
作者: jiaruiqiang    时间: 2011-8-22 15:19
vuser_init()
{

        lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=200.200.203.56:7779", LrsLastArg);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        lr_think_time(7);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        lr_think_time(20);

        lrs_close_socket("socket0");

        lrs_create_socket("socket1", "TCP", "LocalHost=0", "RemoteHost=200.200.203.56:7779", LrsLastArg);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        lrs_create_socket("socket2", "TCP", "LocalHost=0", "RemoteHost=200.200.203.56:9999", LrsLastArg);

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

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

        lr_think_time(11);

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

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

        lr_think_time(4);

        lrs_close_socket("socket1");

        lr_think_time(10);

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

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

        lr_think_time(13);

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

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

        lr_think_time(14);

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

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

        lr_think_time(14);

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

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

        lr_think_time(14);

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

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

        lr_think_time(14);

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

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

        lr_think_time(14);

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

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

        lr_think_time(9);

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

        lrs_close_socket("socket2");

        return 0;
}

这是我录制的一个,都在vuser_init下, 我录制时选择的协议是:Oracle(2-Tier)、Windows Sockets,不知道对不
作者: jiaruiqiang    时间: 2011-8-22 15:39
补充下,我想要做的就是, 用多个用户并发,不停的打开客户端,打开画面,预览,退出,这个循环

还望各路高手指点迷津啊,在线等,先谢谢了啊!




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