fix(接口自动化) 修复场景步骤中路径包含变量问题

--bug=1006790 --user=赵勇 【github#6169】接口自动化导入的jmx中自定义请求端口参数解析出错 https://www.tapd.cn/55049933/s/1049336
This commit is contained in:
fit2-zhao 2021-09-22 16:16:24 +08:00 committed by fit2-zhao
parent 35a8536d90
commit a744b6a2c5
1 changed files with 2 additions and 2 deletions

View File

@ -394,7 +394,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
sampler.setPath(url);
}
if (StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
url = url.replaceAll(this.getPort(), "10990");
url = url.replace(this.getPort(), "10990");
}
try {
URL urlObject = new URL(url);
@ -465,7 +465,7 @@ public class MsHTTPSamplerProxy extends MsTestElement {
url = "http://" + url;
}
if (StringUtils.isNotEmpty(this.getPort()) && this.getPort().startsWith("${")) {
url = url.replaceAll(this.getPort(), "10990");
url = url.replace(this.getPort(), "10990");
}
if (url == null) {
MSException.throwException("请重新选择环境");