【问题标题】:VSTS Load Testing With JMeter plugin PathNotFoundException?使用 JMeter 插件 PathNotFoundException 进行 VSTS 负载测试?
【发布时间】:2017-03-02 14:42:15
【问题描述】:

我在 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 文件或支持文件上传中?非常感谢!

【问题讨论】:

  • 我发现在 JMeter 2.13 版本中使用 JSON 路径提取器时出现问题(与上述相同的错误),但在 JMeter 3.0 上工作正常,我建议您尝试使用 3.0 版本
  • 嗨,纳文!我目前正在使用 JMeter 3.0 (r1743807),我认为这不是问题。

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


【解决方案1】:

这不是 JMeter 或其版本的问题,而是 VSTS 问题,Visual Studio 不识别/支持 JMeter 脚本中使用的 JSON 路径提取器,最好使用正则表达式。

【讨论】:

    【解决方案2】:

    这可能是 JMeter 版本造成的,因为 VSTS 负载测试仍然在测试代理上使用 JMeter 2.13 版本,详情请参阅此链接:Apache JMeter tests

    问:支持的 JMeter 版本是多少?

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

    已经有用户为此提交了声音,你可以在这里投票:Support jMeter 3.0

    【讨论】:

    • 谢谢!我没有意识到这一点,所以切换到 JMeter 2.13 来为 VSTS 生成测试。
    【解决方案3】:

    您的问题是您的计划依赖于 JMeter-plugins 项目的 3rd 方插件 JSON Path Extractor。 所以你需要添加它,只要它的依赖项。

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

    【讨论】:

    • 你好,只要它的依赖怎么添加?能否提供详细步骤。我也有同样的问题。
    • 确保在“支持文件”中包含插件 .jar 文件
    猜你喜欢
    • 2019-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-27
    • 1970-01-01
    • 2011-08-04
    • 1970-01-01
    相关资源
    最近更新 更多