使用 LoadRunner 测试服务器进程
我们目前使用 LoadRunner 来测试我们的 Web 应用程序的性能,但我们还需要测试一些服务器端进程。
背景:
我们将这些过程称为“引擎”。 一个引擎通过轮询 IBM WebSpere MQ 队列中的消息来接收消息。 它将消息从队列中取出,对其进行处理,然后将结果放入出站队列中。 目前,我们通过 TCL 脚本测试该引擎,该脚本读取包含消息的文件,将消息放入入站队列,然后轮询出站队列以获取结果。
另一个引擎通过 Web 服务接收消息。 Web 服务将消息写入数据库中的表中。 引擎轮询数据库表中是否有新消息,获取消息并对其进行处理,然后将结果放回到数据库中。 目前,我们通过 VBScript 脚本测试该引擎,该脚本读取包含消息的文件,将消息发送到 Web 服务,然后继续查询 Web 服务以获取结果,直至其准备就绪。
问:
我们希望废除 TCL 和 VBScript 脚本并在 LoadRunner 上进行标准化,以便我们拥有一种工具来管理所有性能测试。
- 我知道 LoadRunner 支持“开箱即用”的 Web 服务协议,但我不确定如何使用它。 有谁知道如何使用 LoadRunner 测试 Web 服务的示例吗?
- LoadRunner 有 MQ 协议吗? 是否可以使用 LoadRunner Vuser 将负载(放入消息)驱动到 MQ 队列中? 我们需要从惠普或其他供应商那里购买东西才能做到这一点吗?
谢谢 :)
We currently use LoadRunner for performance testing our web apps, but we also have some server side processes we need to test.
Background:
We call these processes our "engines". One engine receives messages by polling an IBM WebSpere MQ queue for messages. It takes a message off the queue, processes it, and puts the result on an outbound queue. We currently test this engine via a TCL script that reads a file that contains the messages, puts the messages on the inbound queue, then polls the outbound queue for the results.
The other engine receives messages via a web service. The web service writes the message to a table in our database. The engine polls the database table for new messages, takes a message and processes it, and puts the result back into the database. We currently test this engine via a VBScript script that reads a file that contains the messages, sends the message to the web service, then keeps querying the web service for the result unitl it's ready.
Question:
We'd like to do away with the TCL and VBScript scripts and standardize on LoadRunner so that we have one tool to manage all our performance tests.
- I know LoadRunner supports a Web Services protocol "out of the box", but I'm not sure how to use it. Does anyone know of any examples of how to use LoadRunner to test a web service?
- Does LoadRunner have a protocol for MQ? Is it possible to use a LoadRunner Vuser to drive load (put messages) into an MQ queue? Would we need to purchase something from HP or some other vendor to do this?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
附带的软件中有一个 LoadRunner 插件,可以与 MQ 系列连接并将消息直接放入队列中。 还完全支持 Web 服务,并且也支持 VBScript,也许在 LoadRunner 中使用 QTPro 作为脚本和 GUI 用户?
科林.
There is an add-in for LoadRunner in the incuded software to interface with MQ series and put the messages directly on the queue. Web services are fully supported also, and VBScript is supported too,perhaps using QTPro for the script and a GUI user in LoadRunner?
Colin.
对于 #1,作为 Web 服务脚本的替代方案,您可以尝试录制 Windows 套接字脚本。 我使用 LoadRunner 记录winsock 脚本来测试一些(Java)API。 我所做的是编写一个非常简单的 Java API 客户端,然后从 Windows 批处理文件执行它。 然后,在 VUGen 中录制 LR 脚本时,批处理文件将被引用为可执行文件。
我不确定 VUGen 是否可以加载 VBScript 文件进行录制,但您可以尝试一下。 否则,您可以尝试将 VBScript 包装在可由 VUGen 运行的批处理文件中。
当VUGen录制winsock脚本时,它基本上是在监视您正在录制的进程的网络通信。 完成记录后,它将在“data.ws”工作表中生成网络数据转储,您可以使用 VUGen 查看和编辑该工作表。 您可以为负载测试参数化此数据工作表。
For #1, as an alternative to a Web Services script, you could try recording a Windows Sockets script. I've used LoadRunner to record winsock scripts to test some (Java) APIs. What I did was write a really simple Java API client and then execute that from a Windows batch file. The batch file would then be referenced as the executable when recording a LR script in VUGen.
I'm not sure if VUGen can load a VBScript file for recording, but you might try. Otherwise, you might try wrapping your VBScript in a batch file that can be run by VUGen.
When VUGen records a winsock script, it's basically monitoring the network communication for the process you're recording with. After you're done recording, it'll generate a dump of the network data in a "data.ws" worksheet that you can look at and edit with VUGen. You can parameterize this data worksheet for your load tests.
人们可以在 LoadRunner 中编写 SOA 请求并解析响应。
请参阅 wilsonmar.com/1lrscript.htm。
但请记住,为功能测试而开发的 TCL 和 VBScript 与 LoadRunner 脚本具有不同的架构和范围。 QTP 和 WinRunner 接管该应用程序。
LoadRunner 脚本专注于通过网络交换数据。 对于无头 SOA XML,这种架构上的区别并不重要。
但是,从 GUI 维护 VBscript 可能更容易,因为在 LoadRunner 中创建 SOA 脚本需要比大多数 MQ 开发人员更深入地了解消息格式。
One can code SOA requests and parse responses within LoadRunner.
See wilsonmar.com/1lrscript.htm.
But bear in mind that TCL and VBScript developed for functional testing have a different architecture and scope than LoadRunner scripts. QTP and WinRunner take over the application.
LoadRunner scripts focus on the exchange of data across the wire. In the case of headless SOA XML, this architectural distinction doesn't matter.
However, it may be easier for you to maintain VBscript from the GUI, because creating SOA scripts in LoadRunner require a deeper understanding of message formats than what most MQ developers have.
您实际上可以通过三种路径从 MQ 队列推送和弹出消息。
使用 LoadRunner (1) MQTester, 这是与 LoadRunner 一起使用的本机 MQ 协议插件
(2)温索克。 Winsock 的开发最好被描述为与从胡椒粉中挑选苍蝇粪便相似。 虽然很乏味,但最终非常有收获。 开箱即用,除了许可证更新(可能)之外,不需要额外的插件
(3) JMS使用Java虚拟用户,参见。 http://en.wikipedia.org/wiki/Java_Message_Service 。 您最终会在 LoadRunner 的 Java 模板虚拟用户中得到一个小型 Java 程序。 您将必须处理与 LoadRunner 相关的所有 Java 黑魔法方面,但是一旦您确定了发布和安装详细信息的组合,您就可以使用虚拟相同的代码发布到几乎任何 JMS 提供程序(不仅仅是 MQ)某些连接工厂设置已更改。
您还应该能够使用 Web 服务虚拟用户执行 JMS,但我尚未测试该配置。 查看运行时设置的 JMS 部分。
You really have three paths for pushing and popping messages off of an MQ queue using LoadRunner
(1) MQTester. This is a native MQ Protocol Add in for use with LoadRunner
(2) Winsock. Winsock development is best described as tedipously similar to picking fly scat out of ground pepper. Tedious, but in the end very rewarding. Out of the box, no additional add ins are required except license updates (possibly)
(3) JMS using a Java Virtual user, see. http://en.wikipedia.org/wiki/Java_Message_Service . You wind up with a small Java program in the Java template virtual user for LoadRunner. You will have to deal with all of the Java black magic aspects associated with LoadRunner, but once you nail down the combination of release and installation details you can use the virtual same code to post to just about any JMS provider (not just MQ) with some connection factory settings changed.
You should be able to do JMS with the web services virtual user as well, but I have not tested that configuration. Look at the JMS section of the run time settings.