51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1856|回复: 1
打印 上一主题 下一主题

[在学] IP欺骗正常按步骤设置,但到最后一步添加查看结果树运行后报错

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2018-1-22 13:45:23 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
说明:
1、本地链接已经手动配置固定IP地址,并在高级中配置2个空闲IP地址,在运行中输入cmd命令后,用ipconfig命令确实显示3个IP地址,如下图:
2、用Badboy录制脚本并导入Jmeter

3、设置一个用作IP参数化的的txt文档,内容如下:
4、在Jmeter中添加CSV Data Set Config,如下图:
5、在脚本的每一个请求中,修改http请求的方式为HttpClient4
6、同样在HTTP请求的Advanced标签中,Source address下选择IPHostnameqie 写上变量名为${ipadress}
7、添加查看结果树并运行查看结果时取样器报错
取样器结果显示如下:
Thread Name: Thread Group 1-1
Sample Start: 2017-06-01 13:52:21 CST
Load time: 1
Connect Time: 1
Latency: 0
Size in bytes: 2355
Headers size in bytes: 0
Body size in bytes: 2355
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.ConnectException
Response message: Non HTTP response message: connect: Address is invalid onlocal machine, or port is not valid on remote machine
Response headers:

HTTPSampleResult fields:
ContentType:
DataEncoding: null
响应数据报错如下:
java.net.ConnectException: connect:Address is invalid on local machine, or port is not valid on remote machine
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    atjava.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    atjava.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    atjava.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    atjava.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    atorg.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:120)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
    atorg.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:328)
    at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
    atorg.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)
    atorg.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
    atorg.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
    atorg.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    atorg.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:619)
    atorg.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:379)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
    atorg.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
    atorg.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
    atorg.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
    atorg.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)
    atorg.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
    at java.lang.Thread.run(Thread.java:745)


在学课程:
JMeter性能测试


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2018-1-22 15:15:05 | 只看该作者
看响应中的报错信息:Address is invalid on local machine, or port is not valid on remote machine
还是IP地址的问题,是不是你设置好了IP地址,实际运行的时候,IP已经无效了?你执行之前,先ping一下这些IP地址,确保这些IP地址没有被使用。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-28 10:45 , Processed in 0.066533 second(s), 25 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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