简体   繁体   English

通过Java代码运行的MVN jmeter Hashtree I / O错误

[英]MVN jmeter Hashtree I/O error for running through java code

Pretty new to jmeter and i am trying to Run an existing JMeter Test from Java code i read from the link below. jmeter刚起步,我正在尝试从下面的链接中读取的Java代码运行现有的JMeter测试。

https://www.blazemeter.com/blog/5-ways-launch-jmeter-test-without-using-jmeter-gui https://www.blazemeter.com/blog/5-ways-launch-jmeter-test-without-using-jmeter-gui

But when i try to follow the instruction im getting a java error. 但是,当我尝试按照说明即时获取Java错误时。 Can someone point out what im doing wrong? 有人可以指出我做错了什么吗? Im pretty new to this. 我对此很陌生。

在此处输入图片说明

The message is pretty clear. 消息很清楚。 SaveService#loadTree no longer accepts an input stream, it wants a file. SaveService#loadTree不再接受输入流,而是需要一个文件。 The link you're referring to was written a couple of years ago, at the time it used a version of the library that still accepted an input stream. 您所指的链接是几年前编写的,当时它使用的是仍接受输入流的库版本。

Change 更改

FileInputStream test = new FileInputStream("src/test/jmeter/ssoLogin.jmx");

to

File test = new File("src/test/jmeter/ssoLogin.jmx");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM