Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#5,770 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java
Ambito
testing-qa

Direzione di ricerca

Inizia con src/components/src/main/java/org/apache/jmeter/extractor/XPathExtractor.java e XPath2Extractor.java nelle chiamate dei messaggi di errore collegate nell’issue. Verifica come il testo aggiunto raggiunge l’output CSV del listener, quindi aggiungi test se il progetto fornisce una posizione di test pertinente. Il lavoro è completato quando gli errori dell’extractor mantengono il testo esplicativo senza inserire un’interruzione di riga che comprometta l’elaborazione CSV.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
9.6k
Fork
2.3k
Merge medio
18h 33m
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/jmeter

Tutte le issue di apache/jmeter

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.