51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

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

使用用户定义变量实现多用户登录的问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2007-2-9 14:21:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
录制了登录的脚本
然后在login页面中想重复使用一个文本文件中的多个用户名反复登录
看了jmeter的用户手册上面写的
                                                                                                                                                                                           Some test plans need to use different values for different users/threads. For example, you might want to test a sequence that requires a unique login for each user.This is easy to achieve with the facilities provided by JMeter.                                               
                                                                                                                                                                                                                                   For example:                                               
                                                                                                                                                                  
  •                                                                 Create a text file containing the user names and passwords, separated by commas.Put this in the same directory as your test plan.
  •                                                                 Add a CSV DataSet configuration element to the test plan.Name the variables USER and PASS.
  •                                                                 Replace the login name with ${USER} and the password with ${PASS} on the appropriatesamplers
                                                                                                                                                                                                                                   The CSV Data Set element will read a new line for each thread.


我在脚本的目录下建立了一个a.txt的文件,里面三行数据
test1,test11
test2,test22
test3,test33
然后在脚本里面添加了CSV DATA SET
VariableNames设置为USER,PASS
然后在login页面里面
对变量USERNAME 设置为"${USER}"  
对变量PASSWORD设置为"${PASS}"
按照说明书上是不是应该这么设置呢。。。。
结果 脚本貌似没有运行成功啊
另外jmeter中有没有类似qaload那种 可以有代码调试界面的脚本调试工具呢
还有脚本录制完成之后大概都怎么调试呢
badboy貌似不错 不过badboy中录制的许多元素在jmeter中都不知道啊 比如什么数据池之类的
头疼ing 有哪位高手能帮个忙 加一下我的QQ 12889938  3x
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2007-3-1 20:03:19 | 只看该作者
1. 把你的数据写成一个csv文件
2. 指定一个变量到这个csv文件 ${_CSVRead()}
3. 使用变量就ok了
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-9-25 11:10 , Processed in 0.079321 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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