fix(接口定义):修复xpath提取器问题
--bug=1007706 --user=赵勇 【github#6222】响应体是html格式,用相同的方法在jmeter里可以提取到信息,在MS无法提取信息 https://www.tapd.cn/55049933/s/1067474
This commit is contained in:
parent
e0883d30aa
commit
28b62a3555
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue