Test--无为之家(kernzhang)

关于重新安装LoadRunner的文档

LoadRunner — 作者 kernzhang @ 10:32

In case that all the above steps fail, the only recourse left would be to try to uninstall LoadRunner. It is possible that either a previous version of LoadRunner was on the machine before the current installation or that the installation did not go properly although the installation did not give any errors. It is recommended that a full uninstall be done in this case. The following steps are for a full uninstall:

 查看全文

关于google的webservice测试脚本

LoadRunner — 作者 kernzhang @ 15:07

最近和一个朋友聊起google wevservice测试的问题,我做了一个小的google webservice脚本,大家有兴趣的可以看看!

LR版本必须在8.0FP1或以上

下载文件后必须把自己的CD_KEY加到CD_KEY,dat文件中,并修改.wsdl的文件路径,然后就可以运行了!

http://blog.itpub.net/resource/7412/8037



关于怎么在LR中模拟下载的动作!并能真实地保存文件

LoadRunner — 作者 kernzhang @ 23:08

当B/S程序在进行下载动作时,弹出对话框这个动作是client的行为,所以LR无法录制下来!我在这个程序里模拟这个动作!并保存下载文件的内容!

我这个脚本写的比较简单!大家可以在上面扩充!比如生成动态的文件名等等!

这个脚本是拿我上载到51testing上的一个脚本为例子的!

大家下载下来修改一下cookie里面的内容就可以执行了!

http://blog.itpub.net/resource/7412/7900



警惕某些服务器厂商在 TPCC 性能指标上搞猫腻 (来自与http://blog.joycode.com/moslem)

LoadRunner — 作者 kernzhang @ 13:31

先说我了解的一个真实案例:某单位要建立一个系统,设计容量是 2008 年要达到 1500 万客户的规模,在花费巨资(将近 100 M $)建设起此系统后,运行只有几个月,客户量也只达到几十万,厂商就说此系统容量不够,要花数 M $ 要扩容,并声称不是拍脑袋是,按 TPCC 计算的结果 ...

以前只大致了解 TPCC 指标的一些情况,平常也就看看 By Performace 和 By Price/Performace 的 Top 10 列表,了解一下各厂商的实力和产品的情况,这次对 TPCC 进行了一下深入了解,发现了一些容易被厂商搞猫腻的地方。

TPCC 简单的来说,就是事务处理性能委员会 TPC 组织针对联机数据库应用系统(OLTP)制定的一个综合性能考评指标,它模拟了一个批发 商的货物管理环境,有标准的数据库结构(Schema),可以很容易的扩展,在此系统中,主要有五类交易:

1. 新订单(New-Order)
2. 支付(Payment ) 43%(最小比例)
3. 订单查询(Order-Status) 4%(最小比例)
4. 交付(Delivery) 4%(最小比例)
5. 库存查询(Stock-Level) 4%(最小比例)

因为 TPCC 指标值主要是衡量“新订单”交易的数量,所以厂商都会趋向于增加新订单交易的数量,这样并不满足实际的应用场景,所以 TPCC 的规范中指定了后四种交易数量的最小比例,这样意味着 “新订单” 的数量最多只能占到45%(这个 45% 不知出于什么原因,在很多 TPCC 的指标介绍中并没有提及)。

这就说明了:如果一台机器有 1000 tpm (Transactions per Minute),那么它实际上处理的交易(请求)为 1000/45% = 2222 ,而实际上大多数厂商在面对用户估算应用系统需要多少个 TPCC 的服务器的时候,是计算所有交易量的,这样带来的评估结果是用户至少买比实际需要大一倍性能容量的机器,获得利益的谁呢?当然是服务器厂商,越高 TPCC 值的机器,价格越高,性价比也一般要偏小。

此外,服务器厂商还容易在以下方面愚弄客户:

1、交易复杂度(用户的一个交易约等于多少个 TPCC 的标准交易),某国际著名的服务器厂商建议此值取 10 - 20 ,这个值也忒大了点, 在 TPCC 的场景,交易也不是很简单的,和实际的应用交易差别并不是很大。

2、按一些峰值指标来计算性能,实际上,这些峰值只是在极少数情况下出现,所以在计算时,应乘以 80% 的系数。

3、预留容量,很多厂商建议预留容量,甚至达到一半,这有点过份,在实际容量要求增高的时候,可以通过服务器的横向扩展来纵向扩展来满足应用要求,何必为未来五年的要求,要在眼下一下子要做全部的硬件投资呢? 何况硬件的价格在不断下降呢。

现在回头来看刚开始的案例,除了说他们愚弄客户,贪得无厌之外,还有什么可说的呢?

BTW:在了解 TPCC 的同时,我整理了一个 TPCC 介绍的 ppt ,其中包含了一个自己总结的估算应用系统所需 TPCC 的公式,这里无法增加附件,有意者可以留言索取(2005.12.31 前)。

 查看全文

Netstat又出一个新参数了

LoadRunner — 作者 kernzhang @ 13:23

自netstat增加了o参数后,Win2003 SP1和XP SP2(未测试)又增加了一个新的参数-"b",还是非常好用的,可以显示出进程名了。

netstat /?

显示协议统计信息和当前 TCP/IP 网络连接。

NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]

-a 显示所有连接和监听端口。
-b 显示包含于创建每个连接或监听端口的
可执行组件。在某些情况下已知可执行组件
拥有多个独立组件,并且在这些情况下
包含于创建连接或监听端口的组件序列
被显示。这种情况下,可执行组件名
在底部的 [] 中,顶部是其调用的组件,
等等,直到 TCP/IP 部分。注意此选项
可能需要很长时间,如果没有足够权限
可能失败。
-e 显示以太网统计信息。此选项可以与 -s
选项组合使用。
-n 以数字形式显示地址和端口号。
-o 显示与每个连接相关的所属进程 ID。
-p proto 显示 proto 指定的协议的连接;proto 可以是
下列协议之一: TCP、UDP、TCPv6 或 UDPv6。
如果与 -s 选项一起使用以显示按协议统计信息,proto 可以是下列协议
之一:
IP、IPv6、ICMP、ICMPv6、TCP、TCPv6、UDP 或 UDPv6。
-r 显示路由表。
-s 显示按协议统计信息。默认地,显示 IP、
IPv6、ICMP、ICMPv6、TCP、TCPv6、UDP 和 UDPv6 的统计信息;
-p 选项用于指定默认情况的子集。
-v 与 -b 选项一起使用时将显示包含于
为所有可执行组件创建连接或监听端口的
组件。
interval 重新显示选定统计信息,每次显示之间
暂停时间间隔(以秒计)。按 CTRL+C 停止重新
显示统计信息。如果省略,netstat 显示当前
配置信息(只显示一次)



脚本编译回放时cci.exe占用大量内存的问题

LoadRunner — 作者 kernzhang @ 10:23

使用ODBC协议录制了一段应用程序中展开结构树的操作,因为这个操作会反复连接读取数据库,所以录制了很长时间才完成,录制过程中LR占用大量内存;
然后点运行回放脚本,结果LR自带的编译程序cci.exe占用内存逐渐增加,导致编译无法完成。

麻烦熟悉LR编译脚本过程的朋友帮我看下这个问题,到底为什么cci.exe会占用那么大的内存

Action.c (107341): Too many local variablesc:documents and settingsadministrator327300303346zhankaicombined_zhankai.c (5): 1 errors, not writing pre_cci.ci

对应的语句为:
lrd_fetchx(Csr8267, 0, 1, 0, PrintRow16524, 1, 0);
/*Note: no rows returned by above lrd_fetch*/

解决方案:

.tools->Regenerate Vusers..
2.选择options编辑recording options
3。选上“Split action section to functions by event”
此种修改适用于LR7.8或以上版本



察看进程端口的工具

LoadRunner — 作者 kernzhang @ 12:22

在利用mercury的agent的时候,因为端口(50500,54345)被别的进程占住,导致无法正常的连接负载生成器中,可以利用这个工具进行检测,然后暂停这个应用!

http://blog.itpub.net/resource/7412/7384



Error: Process 'mdrv.exe' was not created on remote host ''..."

LoadRunner — 作者 kernzhang @ 22:12

Error: "29987 : While running a Vuser on a remote machine, the following error occurs in the Controller:

"-29987 Error: Process 'mdrv.exe' was not created on remote host '<HostName>'.
Reason: Communication error. Make sure the Agent process or service is running on the remote machine."


Solution: Make sure the Agent process or service is running and reachable

Different problems can cause the above error. Some of the things you can verify include:

1. Make sure that you apply the same LoadRunner version and Service Pack on the Controller and Load Generator machines.

2. Make sure that you can ping the Controller and host machines bidirectionally. You may need to add the IP address and machine name on the host file:

  1. Go to the host machine.
  2. Navigate to C:WINNTsystem32driversetc.
  3. Open the hosts file in a word editor.
  4. At the end of the file, add another line with the IP address and machine name of the Controller machine.

    Example:
    111.111.111.111 MI_Controller

  5. Repeat steps a - d for all the host machines.
  6. Repeat steps a - d for the Controller machine, but adding the IP addresses and machine names of the hosts machines.

3. If you are running the Vusers on the Controller machine, try to connect to the Controller's using the machine name or IP, instead of 'localhost'.

4. Make sure that the LoadRunner Agent process or service is running on the remote host machine. 5. If running a Vuser over a Terminal Session for LoadRunner 7.8 or above:

  1. Make sure that the LoadRunner Agent or service is running on all the Terminal Sessions.
  2. Make sure that the number of Load Generators you specified in the Controller does not exceed the number of the Terminal Sessions you launch.
  3. lr_bridge runs on a different terminal than the mdrv process. As such, you need to start an additional Agent (1 + the number of Load Generators specified in the Controller) . This can be accomplished by adding an additional Load Generator machine or by starting an additional Terminal Session.

    Note:
    If you face any problems connecting to Terminal Sessions when they are open, close all the sessions and try again. The order in which the Terminal Sessions are opened matters.

 查看全文

Error: "Connection to host failed. Communication problem..."

LoadRunner — 作者 kernzhang @ 22:10

When attempting to connect to the host machine, the following error is received.

"Connection to host failed.
Communication problem:
rpc: RPC call failed.
rpc: Server did not allow operation; client has insufficient permissions."

Diagnosis:The error occurs because of access permission of the Remote Command Launcher.

If the Remote Command Launcher icon has a lock next to the satelite dish, the file called rcmdl.hst was created with a listing of all the IP addresses or host names that can get access to this Remote Command Launcher.


Solution: Modify rcmdl.hst

You need to modify the rcmdl.hst.

1. Right-click on the Remote Command Launcher and select Edit Permission.

2. After editting, save the file.

3. Right-click on the Remote Command Launcher and select Update Permission.

Note:
By default, the permission of the Remote Command Launcher is open to everyone because this file does not exist.



java GC document

LoadRunner — 作者 kernzhang @ 22:24

http://www-128.ibm.com/developerworks/cn/java/j-perf05214/index.html

http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/jvmpi.html



关于如何在LR录制SSH方式登陆服务器的脚本

LoadRunner — 作者 kernzhang @ 11:53

首先要表明的是LR现在尚不能录制SSH登陆方式的程序,现在唯一能做的是通过另外的一个途径绕过!

LR提供了RTE协议,可以录制telnet的程序,我们将借助telnet的session登陆到ssh的服务器上,配置如下:

1。Disable NTLM authentication for the Telnet server:(你可以在控制面板---> telnet服务器管理)将此项修改!

2。Install the OpenSSH client for Windows(网址:http://sshwindows.sourceforge.net/

3。测试SSH方式登陆服务器。

4。测试在telnet session方式下以ssh方式登陆服务器!

5。在VUGEN以RTE方式录制脚本,登陆方式就按照原来的测试方式进行操作就行了!



Web recorder does not support the default registered browser的解决方法(Netscape 7.0.1)

LoadRunner — 作者 kernzhang @ 16:17
Netscape 7.01 or lower version is supported as a default browser in the multi-protocol Web Recorder of VuGen 7.6 and above. The following is for lower versions of LoadRunner.


Record against Netscape 7.01 using the "Manually launch an application" option.

1. Launch a new Web Vuser.
2. Go to Tools -> Recording Options -> Browser tab -> Manually launch the Browser.
3. Start recording and a "Web Recorder" pop-up box will launch.

Note:
Remember the host name and machine name on that box. Do not click the "OK" button in the "Web Recorder" window just yet.

4. Launch Netscape 7.01. Select Edit -> Preferences -> Advanced -> Proxies.
5. Select "Manual proxy configuration" and set the Address field. The port needs to be the same as that mentioned in the "Web Recorder" dialog box. (The port is usually 7777.)
6. Click <OK> to all the pop-up windows.
7. Now, go ahead and click <OK> in the "Web Recorder" window.
8. Enter the URL in the browser Address field and refresh the page.
9. Events will be recorded in VuGen now.

Note:You may encounter problems recording in Netscape when another Netscape browser is already running on the same machine. It is recommended to close the extra browser.



Vusers do not hit a different server with Load Balancer in place, disabling "DNS caching" has no effect

LoadRunner — 作者 kernzhang @ 16:14

Disable the OS caching

You need to disable the OS caching on the machine where you run the Vusers.

For Windows 2000:
1. Start the Registry Editor (Start -> Run -> regedit).
2. Locate the MaxCacheEntryTtlLimit value under the registry key:

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesDnscacheParameters

3. In the Edit menu, click <Modify>. Type "1," and click <OK>.
4. Quit the Registry Editor.



How to switch IP Spoofing on/off after setting it up

LoadRunner — 作者 kernzhang @ 16:07

Turn "Enable IP Spoofer" on and off

Setting up a host (generator) for IP Spoofing simply means that the generator machine has additional valid IP addresses added to the system. What actually controls the use of the IP Spoofing is the Controller. In the Controller, you can enable or disable IP Spoofing by going to Scenario -> Enable IP Spoofer.

Even if you have additional IPs added to generators, if the above option is not turned on, IP Spoofing will not occur during scenario execution. There is no need to remove the additional IPs when switching IP Spoofing on and off.

Apart from that, you should disconnect and reconnect to the Load Generator after turning IP spoofing on or off for the setting to take effect.

 查看全文

How to set up multiple IP addresses for a Java Vuser

LoadRunner — 作者 kernzhang @ 16:05

You can use web.set_sockets_option to sepcify the IP address.

1. Import lrapi.web; in the Java script.

Example:
import lrapi.web;

2. Add the web.set_sockets_option function to set the option for the sockets.

Example:
web.set_sockets_option("USER_IP_ADDRESS", "<IP_ADDRESS>");

where "IP_ADDRESS" is a LoadRunner parameter pointing to a data file having a list of the IP addresses you wish to spoof. Set the property of this parameter to Unique.

Note:
The typical methodology of using the Scenario -> Enabled IP Spoofer in the Controller is not supported for Java Vusers.



当加weblogic的jmx监控时出现Mismatch for the java virtual machine version.错误的解决方法

LoadRunner — 作者 kernzhang @ 15:10
Make sure the right version is installed (you many need to reinstall JVM), or
2. Make sure the JVM entry in WebLogicMon.ini points to the correct location:
    a. Bring up <LoadRunner>datmonitorsWebLogicMon.ini
    b. On the entry for JVM, set the full path to the correct java.exe. For example:
    JVM=c:jdk1.3binjava.exe
    c. Make sure that the 慗avaVersion=?entry mention the correct JVM version
 查看全文

LR Monitor支持weblogic哪些版本

LoadRunner — 作者 kernzhang @ 15:08

支持Weblogic5.X--8.X



当LR在监控DB2数据库时抱错“Unable to initalize db2mon_adapter.dll”

LoadRunner — 作者 kernzhang @ 14:50
原因是LR只支持6.X或者7.X的版本!早期的DB2版本LR并不支持!

在LR中出现"SQLError=[Microsoft][ODBC SQL Server Driver]" 的解决方法

LoadRunner — 作者 kernzhang @ 13:35

e reason for this failure is the size of the string that is being used for that field during recording is saved into a variable descriptor located in the vdf.h file under the main script folder. This value is being referenced during replay. When the parameter in the script tries to replace it with a longer string value, it complains.

Example:
Original value recorded in the script before parameterization:
lrd_assign(&_20_D66, "12345", 0, 0, 0);
Number of characters in second argument is 5

After parameterization with another value:
lrd_assign(&_20_D66, "12345678", 0, 0, 0);
Number of characters in second argument is 8


Solution: Record with the longest string and pad substituted parameters to that length



在LR以ODBC协议录制过程中如何将Connect()中的密文改为明文

LoadRunner — 作者 kernzhang @ 13:31
  1. Go to <WinDir>vugen.ini and edit it with notepad.

  2. Add AutoPasswordEncryption=OFF to the [LRDCodeGeneration] section of vugen.ini file.
    Note: Make sure that [LRDCodeGeneration] appears only once in the file.



关于google的webservice测试脚本

LoadRunner — 作者 kernzhang @ 00:00

有个朋友挑起我做google webservice脚本的兴趣,现做了一个小的webservice脚本,有兴趣的朋友可以看看!

LR 版本必须在8.0FP1以上

脚本中大家必须用自己的CD_KEY,把CD_KEY加载CD}_KEY.dat文件中即可!并在脚本中修改.wsdlL文件路径就可以回放!

http://blog.itpub.net/resource/7412/8037



Powered by pLog