diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java index f5e05c241b..1cfd86c207 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java @@ -10,7 +10,7 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.jmeter.extractor.JSR223PostProcessor; import org.apache.jmeter.extractor.RegexExtractor; -import org.apache.jmeter.extractor.XPath2Extractor; +import org.apache.jmeter.extractor.XPathExtractor; import org.apache.jmeter.extractor.json.jsonpath.JSONPostProcessor; import org.apache.jmeter.save.SaveService; import org.apache.jmeter.testelement.TestElement; @@ -94,16 +94,16 @@ public class MsExtract extends MsTestElement { return extractor; } - private XPath2Extractor xPath2Extractor(MsExtractXPath extractXPath, StringJoiner extract) { - XPath2Extractor extractor = new XPath2Extractor(); + private XPathExtractor xPath2Extractor(MsExtractXPath extractXPath, StringJoiner extract) { + XPathExtractor extractor = new XPathExtractor(); extractor.setEnabled(this.isEnable()); + extractor.setTolerant(true); extractor.setName(StringUtils.isNotEmpty(extractXPath.getVariable()) ? extractXPath.getVariable() : this.getName()); if(StringUtils.isEmpty(extractor.getName())){ extractor.setName("XPath2Extractor"); } - /*extractor.setName(StringUtils.isNotEmpty(this.getName()) ? this.getName() : " XPath2Extractor");*/ - extractor.setProperty(TestElement.TEST_CLASS, XPath2Extractor.class.getName()); - extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XPath2ExtractorGui")); + extractor.setProperty(TestElement.TEST_CLASS, XPathExtractor.class.getName()); + extractor.setProperty(TestElement.GUI_CLASS, SaveService.aliasToClass("XPathExtractorGui")); extractor.setRefName(extractXPath.getVariable()); extractor.setXPathQuery(extractXPath.getExpression()); if (extractXPath.isMultipleMatching()) {