Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

XPath and XPath2 extractors insert a new line in the failure message which breaks CSV log file formatting for the listener.

未关闭 适合新手
#5,770 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
java
领域
testing-qa

调研方向

从 issue 中链接的失败消息调用处开始检查 src/components/src/main/java/org/apache/jmeter/extractor/XPathExtractor.java 和 XPath2Extractor.java。检查追加的文本如何到达 listener 的 CSV 输出;如果项目提供了相关的测试位置,则添加覆盖。完成的标准是 extractor 失败时保留解释性文本,且不插入会干扰 CSV 处理的换行符。

由索引模型根据 Issue 内容生成。

描述

invalid wontfix

Using an XPath or XPath2 extractor on a http sampler.
If the http sampler fails, or the response is empty, or not in the expected format, the extractor fails and appends text to its failure message
This appended text inserts a new line character before the appended text.
The new line character is logged by listener when logging the failure message, and breaks the file format when the listener is logging as CSV.

These files
ass.setFailureMessage(thrown.getLocalizedMessage()+"\nSee log file for further details.");
Line 199 XPath Extractor

ass.setFailureMessage(thrown.getLocalizedMessage()+"\nSee log file for further details.");
[Line 165 XPath2] (https://github.com/apache/jmeter/blob/c7279348335b820c35ee570462cb2e0b4eb1c370/src/components/src/main/java/org/apache/jmeter/extractor/XPath2Extractor.java)

Example CSV output :

timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Filename,Latency,Encoding,SampleCount,ErrorCount,Hostname,IdleTime,Connect
2023/02/03 10:16:46.263,213,Test,502,FailureMessage,Thread Group 1-1,text,false,"Premature end of file.
See log file for further details.",0,0,1,1,null,,0,ISO-8859-1,1,1,MachineName,0,0

This should look like

timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Filename,Latency,Encoding,SampleCount,ErrorCount,Hostname,IdleTime,Connect
2023/02/03 10:16:46.263,213,Test,502,FailureMessage,Thread Group 1-1,text,false,"Premature end of file. See log file for further details.",0,0,1,1,null,,0,ISO-8859-1,1,1,SBGMLXNK094VJCR,0,0

The problem this causes is the file then cannot be processed as a valid CSV without manually correcting/removing the new lines, eg a post test JMeter report cannot be generated as it cannot read the file as a CSV format.

主要语言
Java
星标
9.6k
派生
2.3k
平均合并
18 小时 33 分钟
30 天内合并 PR
12

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/jmeter 的其他 Issue

查看 apache/jmeter 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。