IP欺骗设置IP工具:IP Wizard 开启IP欺骗时会关闭DHCP(也就是关闭IP自动获取 更改为手动设置IP)
注:添加IP欺骗,和释放IP,都要重启机器后才会生效,IP Wizard要管理员身份运行;
在controller中使用ip欺骗的注意事项;
(1)勾选“场景”->“启用IP欺骗器”;
(2)勾选“工具”->“专家模式”;
(3)“场景”->“选项”->“常规”->“多个IP地址模式”;
设置IP欺骗后,验证其是否生效;有两种方法查看:
(1)可用如下代码段来查看:
char *ip = lr_get_vuser_ip();
if (ip)
lr_output_message("The IP address is %s", ip);
else
lr_output_message("IP spoofing disabled");
(2)controller的运行页,运行完场景后,在通过、失败的虚拟用户处,右键可显示VUser日志,弹出的提示框头几行就有显示当前使用的IP;
LoadRunner ==》Controller 开启IP欺骗后遇见如下错误
报错信息:Error: Socket descriptor not found. Hint: the problem might be solved applying the following: (1) Update Run-Time Settings to Run Vuser as a process. (2) Add the following line into mdrv.dat, [lr_socks] section: 'ExtCmdLineConc=-UsingWinInet Yes'.”
解决方法:
(1)run-time setting =》 Miscellaneous设置为“run vuser as a process”
(2)安装目录dat =》 mdrv.dat,找到[lr_socks]段,在最后添加“ExtCmdLineConc=-UsingWinInet Yes”一句;
(3)在Controller =》 expert mode后,选择option->general,选中“ip address allocation per process”;
(4)Controller =》 Diagnostics->configuration项,将web page diagnostics项disable掉