0

Pretty new to jmeter and i am trying to Run an existing JMeter Test from Java code i read from the link below.

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. Can someone point out what im doing wrong? Im pretty new to this.

enter image description here

Ardesco
  • 7,281
  • 26
  • 49

1 Answers1

0

The message is pretty clear. SaveService#loadTree no longer accepts an input stream, it wants a file. 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");
Luciano van der Veekens
  • 6,307
  • 4
  • 26
  • 30
  • Thanks i actually tried that but then it couldnt resolve the method close for test.close(). So im not srue if running jmeter this way will work. – robotcollector Jun 25 '17 at 19:10
  • So i tried running it and this is what i got. 116 [main] INFO org.apache.jmeter.util.JMeterUtils - Setting Locale to en_US 1102 [main] INFO org.apache.jmeter.save.SaveService - Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 1181 [main] ERROR org.apache.jmeter.save.SaveService - Can't compute checksum for saveservice properties file java.io.FileNotFoundException: src\test\jmeter\bin\saveservice.properties (The system cannot find the path specified) at java.io.FileInputStream.open0(Native Method) – robotcollector Jun 25 '17 at 19:12