51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1593|回复: 2
打印 上一主题 下一主题

[原创] 急!!!求解释,用loadrunner测试C\S模式的问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2011-8-19 16:50:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
近期要给一个后台管理系统做性能测试,它是C\S模式的,数据库是oracle的,客户端是用VB写的。
我用loadrunner的oracle(2-tier)协议录制了一个脚本。
我想问这么在脚本中找到客户端的用户名和密码,在脚本中我只找到数据库的用户名和密码。
脚本如下,请高手帮忙解惑,谢谢
Action()
{

        lrd_init(&InitInfo, DBTypeVersion);
        lrd_open_connection(&Con15, LRD_DBTYPE_ORACLE, "busbike", lr_decrypt("4e4e07ffdae767013106cb"), "10.71.0.123", lr_decrypt("4e4dfa67e"), 0, 0, 0);
        lrd_db_option(Con15, OT_ORACLE_AUTOCOMMIT, "ON", 0);
        lrd_open_cursor(&Csr32, Con15, 0);
        lrd_stmt(Csr32, "select '00.00.0000 '||banner, user, 99/100 from v$version where "
        "banner like 'Oracle%'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_bind_cols(Csr32, BCInfo_D4, 0);
        lrd_exec(Csr32, 0, 0, 0, 0, 0);
        lrd_fetch(Csr32, 1, 1, 0, PrintRow4, 0);
        GRID(4);








        lrd_close_cursor(&Csr32, 0);
        lrd_open_cursor(&Csr33, Con15, 0);
        lrd_stmt(Csr33,
        "select oper_tbl.*, oper_tbl.ROWID from oper_tbl where OPER_ID='1001'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr33, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr33, BCInfo_D11, 0);
        lrd_fetch(Csr33, -1, 52, 0, PrintRow8, 0);
        GRID(8);








        lrd_open_connection(&Con16, LRD_DBTYPE_ORACLE, "busbike", lr_decrypt("4e4dfa67c89a128319a212"), "10.71.0.123", lr_decrypt("4e4dfa67e"), 0, 0, 0);
        lrd_db_option(Con16, OT_ORACLE_AUTOCOMMIT, "ON", 0);
        lrd_open_cursor(&Csr34, Con16, 0);
        lrd_stmt(Csr34, "select '00.00.0000 '||banner, user, 99/100 from v$version where "
        "banner like 'Oracle%'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_bind_cols(Csr34, BCInfo_D15, 0);
        lrd_exec(Csr34, 0, 0, 0, 0, 0);
        lrd_fetch(Csr34, 1, 1, 0, PrintRow12, 0);
        GRID(12);








        lrd_close_cursor(&Csr34, 0);
        lrd_open_cursor(&Csr35, Con16, 0);
        lrd_stmt(Csr35,
        "select to_char(sysdate,'YYYY-MM-DD hh24:mi:ss'), dual.ROWID from dual", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr35, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr35, BCInfo_D18, 0);
        lrd_fetch(Csr35, -1, 108, 0, PrintRow16, 0);
        GRID(16);








        lrd_close_cursor(&Csr33, 0);
        lrd_close_cursor(&Csr35, 0);
        lrd_close_connection(&Con16, 1 /*Commit*/, 0);
        lrd_close_connection(&Con15, 1 /*Commit*/, 0);
        lr_think_time(4);

        lrd_open_connection(&Con17, LRD_DBTYPE_ORACLE, "busbike", lr_decrypt("4e4dfa67c89a128319a212"), "10.71.0.123", lr_decrypt("4e4dfa67e"), 0, 0, 0);
        lrd_db_option(Con17, OT_ORACLE_AUTOCOMMIT, "ON", 0);
        lrd_open_cursor(&Csr36, Con17, 0);
        lrd_stmt(Csr36, "select '00.00.0000 '||banner, user, 99/100 from v$version where "
        "banner like 'Oracle%'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_bind_cols(Csr36, BCInfo_D22, 0);
        lrd_exec(Csr36, 0, 0, 0, 0, 0);
        lrd_fetch(Csr36, 1, 1, 0, PrintRow20, 0);
        GRID(20);








        lrd_close_cursor(&Csr36, 0);
        lrd_open_cursor(&Csr37, Con17, 0);
        lrd_stmt(Csr37,
        "select NET_BATCH, NET_MANAGE_TBL.ROWID from NET_MANAGE_TBL group by NET_BATCH", -1, 0, 1 /*Dflt Ora Ver*/, 1);
        lrd_stmt(Csr37, "select NET_BATCH from NET_MANAGE_TBL group by NET_BATCH", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr37, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr37, BCInfo_D24, 0);
        lrd_fetch(Csr37, -1, 224, 0, PrintRow24, 0);
        GRID(24);








        lrd_open_connection(&Con18, LRD_DBTYPE_ORACLE, "busbike", lr_decrypt("4e4dfa67c89a128319a212"), "10.71.0.123", lr_decrypt("4e4dfa67e"), 0, 0, 0);
        lrd_db_option(Con18, OT_ORACLE_AUTOCOMMIT, "ON", 0);
        lrd_open_cursor(&Csr38, Con18, 0);
        lrd_stmt(Csr38, "select '00.00.0000 '||banner, user, 99/100 from v$version where "
        "banner like 'Oracle%'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_bind_cols(Csr38, BCInfo_D28, 0);
        lrd_exec(Csr38, 0, 0, 0, 0, 0);
        lrd_fetch(Csr38, 1, 1, 0, PrintRow28, 0);
        GRID(28);








        lrd_close_cursor(&Csr38, 0);
        lrd_open_cursor(&Csr39, Con18, 0);
        lrd_stmt(Csr39,
        "select SUB_CITY,SUB_CITY_NAME, sub_city_corr_tbl.ROWID from sub_city_corr_tbl", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr39, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr39, BCInfo_D32, 0);
        lrd_fetch(Csr39, -10, 60, 0, PrintRow32, 0);
        GRID(32);








        lrd_close_cursor(&Csr37, 0);
        lrd_open_cursor(&Csr40, Con17, 0);
        lrd_stmt(Csr40,
        "select gene_city,gent_city_name, gene_city_corr_tbl.ROWID from gene_city_corr_tbl", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr40, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr40, BCInfo_D36, 0);
        lrd_fetch(Csr40, -5, 60, 0, PrintRow36, 0);
        GRID(36);








        lrd_close_cursor(&Csr39, 0);
        lrd_close_cursor(&Csr40, 0);
        lrd_close_connection(&Con17, 1 /*Commit*/, 0);
        lrd_close_connection(&Con18, 1 /*Commit*/, 0);
        lr_think_time(4);

        lrd_open_connection(&Con19, LRD_DBTYPE_ORACLE, "busbike", lr_decrypt("4e4dfa67c89a128319a212"), "10.71.0.123", lr_decrypt("4e4dfa67e"), 0, 0, 0);
        lrd_db_option(Con19, OT_ORACLE_AUTOCOMMIT, "ON", 0);
        lrd_open_cursor(&Csr41, Con19, 0);
        lrd_stmt(Csr41, "select '00.00.0000 '||banner, user, 99/100 from v$version where "
        "banner like 'Oracle%'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_bind_cols(Csr41, BCInfo_D40, 0);
        lrd_exec(Csr41, 0, 0, 0, 0, 0);
        lrd_fetch(Csr41, 1, 1, 0, PrintRow40, 0);
        GRID(40);








        lrd_close_cursor(&Csr41, 0);
        lrd_open_cursor(&Csr42, Con19, 0);
        lrd_stmt(Csr42, "select NET_MANAGE_TBL.*, NET_MANAGE_TBL.ROWID from NET_MANAGE_TBL", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr42, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr42, BCInfo_D51, 0);
        lrd_fetch(Csr42, -6, 8, 0, PrintRow44, 0);
        GRID(44);








        lrd_open_connection(&Con20, LRD_DBTYPE_ORACLE, "busbike", lr_decrypt("4e4dfa67c89a128319a212"), "10.71.0.123", lr_decrypt("4e4dfa67e"), 0, 0, 0);
        lrd_db_option(Con20, OT_ORACLE_AUTOCOMMIT, "ON", 0);
        lrd_open_cursor(&Csr43, Con20, 0);
        lrd_stmt(Csr43, "select '00.00.0000 '||banner, user, 99/100 from v$version where "
        "banner like 'Oracle%'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_bind_cols(Csr43, BCInfo_D55, 0);
        lrd_exec(Csr43, 0, 0, 0, 0, 0);
        lrd_fetch(Csr43, 1, 1, 0, PrintRow48, 0);
        GRID(48);








        lrd_close_cursor(&Csr43, 0);
        lrd_open_cursor(&Csr44, Con20, 0);
        lrd_stmt(Csr44, "select SUB_CITY,SUB_CITY_NAME, sub_city_corr_tbl.ROWID from "
        "sub_city_corr_tbl where sub_city = 1", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr44, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr44, BCInfo_D59, 0);
        lrd_fetch(Csr44, -1, 60, 0, PrintRow52, 0);
        GRID(52);








        lrd_open_connection(&Con21, LRD_DBTYPE_ORACLE, "busbike", lr_decrypt("4e4dfa67c89a128319a212"), "10.71.0.123", lr_decrypt("4e4dfa67e"), 0, 0, 0);
        lrd_db_option(Con21, OT_ORACLE_AUTOCOMMIT, "ON", 0);
        lrd_open_cursor(&Csr45, Con21, 0);
        lrd_stmt(Csr45, "select '00.00.0000 '||banner, user, 99/100 from v$version where "
        "banner like 'Oracle%'", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_bind_cols(Csr45, BCInfo_D63, 0);
        lrd_exec(Csr45, 0, 0, 0, 0, 0);
        lrd_fetch(Csr45, 1, 1, 0, PrintRow56, 0);
        GRID(56);








        lrd_close_cursor(&Csr45, 0);
        lrd_open_cursor(&Csr46, Con21, 0);
        lrd_stmt(Csr46, "select SUB_CITY,SUB_CITY_NAME, sub_city_corr_tbl.ROWID from "
        "sub_city_corr_tbl where sub_city = 2", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr46, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr46, BCInfo_D67, 0);
        lrd_fetch(Csr46, -1, 60, 0, PrintRow60, 0);
        GRID(60);








        lrd_close_cursor(&Csr44, 0);
        lrd_open_cursor(&Csr47, Con20, 0);
        lrd_stmt(Csr47, "select SUB_CITY,SUB_CITY_NAME, sub_city_corr_tbl.ROWID from "
        "sub_city_corr_tbl where sub_city = 4", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr47, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr47, BCInfo_D71, 0);
        lrd_fetch(Csr47, -1, 60, 0, PrintRow64, 0);
        GRID(64);








        lrd_close_cursor(&Csr46, 0);
        lrd_open_cursor(&Csr48, Con21, 0);
        lrd_stmt(Csr48, "select SUB_CITY,SUB_CITY_NAME, sub_city_corr_tbl.ROWID from "
        "sub_city_corr_tbl where sub_city = 1", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr48, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr48, BCInfo_D75, 0);
        lrd_fetch(Csr48, -1, 60, 0, PrintRow68, 0);
        GRID(68);








        lrd_close_cursor(&Csr47, 0);
        lrd_open_cursor(&Csr49, Con20, 0);
        lrd_stmt(Csr49, "select SUB_CITY,SUB_CITY_NAME, sub_city_corr_tbl.ROWID from "
        "sub_city_corr_tbl where sub_city = 6", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr49, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr49, BCInfo_D79, 0);
        lrd_fetch(Csr49, -1, 60, 0, PrintRow72, 0);
        GRID(72);








        lrd_close_cursor(&Csr48, 0);
        lrd_open_cursor(&Csr50, Con21, 0);
        lrd_stmt(Csr50, "select SUB_CITY,SUB_CITY_NAME, sub_city_corr_tbl.ROWID from "
        "sub_city_corr_tbl where sub_city = 4", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr50, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr50, BCInfo_D83, 0);
        lrd_fetch(Csr50, -1, 60, 0, PrintRow76, 0);
        GRID(76);








        lrd_close_cursor(&Csr49, 0);
        lrd_open_cursor(&Csr51, Con20, 0);
        lrd_stmt(Csr51, "select count(*) as netcount,sum(bike_num) as netbikenum,sum"
        "(term_num) as nettermnum from (select * from NET_MANAGE_TBL)", -1, 0, 1 /*Dflt Ora Ver*/, 0);
        lrd_exec(Csr51, 0, 0, 0, 0, 0);
        lrd_bind_cols(Csr51, BCInfo_D87, 0);
        lrd_fetch(Csr51, -1, 60, 0, PrintRow80, 0);
        GRID(80);








        lrd_close_cursor(&Csr42, 0);
        lrd_close_cursor(&Csr50, 0);
        lrd_close_cursor(&Csr51, 0);
        lrd_close_connection(&Con20, 1 /*Commit*/, 0);
        lrd_close_connection(&Con21, 1 /*Commit*/, 0);
        lrd_close_connection(&Con19, 1 /*Commit*/, 0);
        return 0;
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2011-8-20 11:33:26 | 只看该作者
你这个协议只录制与数据库有关的。要用多协议
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2011-8-21 19:46:32 | 只看该作者
回复 2# TEST_HUAN
那应该用那些协议,求指导??
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-8 23:43 , Processed in 0.077000 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表