使用JMeter插件进行VSTS负载测试PathNotFoundException?

时间:2016-10-20 14:21:40

标签: visual-studio jmeter azure-devops load-testing

我在JMeter中创建了一个负载测试来检索有效的访问令牌,然后对我的webAPI执行多个请求以测试查询,这在JMeter中有效。

我的测试计划使用JSONPathExtractor插件从JSON响应中提取令牌,然后将该令牌存储为用于继续测试组的属性。 我想在Visual Studio Team Services中上传并运行这些JMeter测试,但是在初始化测试运行时我得到了“服务中发生内部错误”。

以下是VSTS生成的日志文件:

2016/10/20 13:26:22 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
2016/10/20 13:26:22 INFO  - jmeter.JMeter: Loading user properties from: C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\Downloads\0\approot\JMeterLoadTest\clt_jmeterdrop\bin\user.properties 
2016/10/20 13:26:22 INFO  - jmeter.JMeter: Loading system properties from: C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\Downloads\0\approot\JMeterLoadTest\clt_jmeterdrop\bin\system.properties 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: Copyright (c) 1998-2015 The Apache Software Foundation 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: Version 2.13 r1665067 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: java.version=1.8.0_60 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: os.name=Windows Server 2012 R2 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: os.arch=amd64 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: os.version=6.3 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: file.encoding=Cp1252 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: JMeterHome=C:\Packages\Plugins\Microsoft.Compute.CustomScriptExtension\1.8\Downloads\0\approot\JMeterLoadTest\clt_jmeterdrop 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: user.dir  =C:\Windows\system32 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: PWD       =C:\Windows\System32 
2016/10/20 13:26:23 INFO  - jmeter.JMeter: IP: 10.0.0.4 Name: vstsloadagent0 FullName: vstsloadagent0.oykuxugkk15uzmtpoj4pw2mxgh.fx.internal.cloudapp.net 
2016/10/20 13:26:23 INFO  - jmeter.services.FileServer: Default base='C:\Windows\system32' 
2016/10/20 13:26:23 INFO  - jmeter.services.FileServer: Set new base='d:\0\td\99ed1\TestRun\Out' 
2016/10/20 13:26:23 INFO  - jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 
2016/10/20 13:26:23 INFO  - jmeter.save.SaveService: Using SaveService properties file encoding UTF-8 
2016/10/20 13:26:23 INFO  - jmeter.save.SaveService: Using SaveService properties file version 1656252 
2016/10/20 13:26:23 INFO  - jmeter.save.SaveService: Using SaveService properties version 2.8 
2016/10/20 13:26:23 INFO  - jmeter.save.SaveService: All converter versions present and correct 
2016/10/20 13:26:23 INFO  - jmeter.save.SaveService: Loading file: d:\0\td\99ed1\TestRun\Out\JMeter Tile Test (Complete).jmx 
2016/10/20 13:26:23 INFO  - jmeter.protocol.http.control.CookieManager: Settings: Delete null: true Check: true Allow variable: true Save: false Prefix: COOKIE_ 
2016/10/20 13:26:23 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default 
2016/10/20 13:26:23 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is  
2016/10/20 13:26:23 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is  
2016/10/20 13:26:23 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is  
2016/10/20 13:26:23 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is  
2016/10/20 13:26:23 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 
2016/10/20 13:26:23 ERROR - jmeter.JMeter: Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'d:\0\td\99ed1\TestRun\Out\JMeter Tile Test (Complete).jmx', conversion error com.thoughtworks.xstream.converters.ConversionException: com/jayway/jsonpath/PathNotFoundException : com/jayway/jsonpath/PathNotFoundException
---- Debugging information ----
message             : com/jayway/jsonpath/PathNotFoundException
cause-exception     : java.lang.NoClassDefFoundError
cause-message       : com/jayway/jsonpath/PathNotFoundException
first-jmeter-class  : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:102)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree[3]/hashTree/hashTree[3]/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
line number         : 118
version             : 2.13 r1665067
-------------------------------
    at org.apache.jmeter.save.SaveService.readTree(SaveService.java:586)
    at org.apache.jmeter.save.SaveService.loadTree(SaveService.java:537)
    at org.apache.jmeter.JMeter.runNonGui(JMeter.java:750)
    at org.apache.jmeter.JMeter.startNonGui(JMeter.java:737)
    at org.apache.jmeter.JMeter.start(JMeter.java:395)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.jmeter.NewDriver.main(NewDriver.java:264)
Caused by: com.thoughtworks.xstream.converters.ConversionException: com/jayway/jsonpath/PathNotFoundException : com/jayway/jsonpath/PathNotFoundException
---- Debugging information ----
message             : com/jayway/jsonpath/PathNotFoundException
cause-exception     : java.lang.NoClassDefFoundError
cause-message       : com/jayway/jsonpath/PathNotFoundException
first-jmeter-class  : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:102)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree[3]/hashTree/hashTree[3]/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor
line number         : 118
version             : 2.13 r1665067
-------------------------------
    at org.apache.jmeter.save.ScriptWrapperConverter.createConversionException(ScriptWrapperConverter.java:105)
    at org.apache.jmeter.save.ScriptWrapperConverter.unmarshal(ScriptWrapperConverter.java:97)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1206)
    at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1190)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1061)
    at org.apache.jmeter.save.SaveService.readTree(SaveService.java:559)
    ... 9 more
Caused by: java.lang.NoClassDefFoundError: com/jayway/jsonpath/PathNotFoundException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:102)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
    at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
    at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
    at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
    at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
    at org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
    at org.apache.jmeter.save.ScriptWrapperConverter.unmarshal(ScriptWrapperConverter.java:95)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: com.jayway.jsonpath.PathNotFoundException
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 59 more

VSTS负载测试似乎无法找到JSONPathExtractor插件。如何在我的.jmx文件或支持文件上传中包含此内容?非常感谢!

3 个答案:

答案 0 :(得分:2)

这可能是由JMeter版本引起的,因为VSTS负载测试仍在测试代理上使用JMeter 2.13版本,请参阅此链接了解详细信息:Apache JMeter tests

  

问:支持的JMeter版本是什么?

     

答:负载测试代理运行最新的Apache JMeter 2.13版   版本目前可用。

已经为此提交了用户语音,您可以在此处投票:Support jMeter 3.0

答案 1 :(得分:1)

您的问题是您的计划依赖于JMeter-plugins项目的第三方插件JSON Path Extractor。 因此,只要依赖它就需要添加它。

但更好的选择是使用JMeter 3.0和原生JSON后处理器:

答案 2 :(得分:1)

这不是JMeter的问题,也不是它的版本,它的VSTS问题,Visual Studio不识别/支持JMeter脚本中使用的JSON Path Extractor,更好用正则表达式。