diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java index e2e049a5ca..6b84894b92 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/MsHTTPElementConverter.java @@ -96,7 +96,7 @@ public class MsHTTPElementConverter extends AbstractJmeterElementConverter { if (CollectionUtils.isEmpty(formValues)) { return; } - List validFormValues = formValues.stream().filter(FormDataKV::isValid).collect(Collectors.toList()); + List validFormValues = formValues.stream() + .filter(FormDataKV::getEnable) + .filter(FormDataKV::isValid) + .collect(Collectors.toList()); List fileFormValues = validFormValues.stream().filter(FormDataKV::isFile).collect(Collectors.toList()); List textFormValues = validFormValues.stream().filter(kv -> !kv.isFile()).collect(Collectors.toList()); sampler.setHTTPFiles(getHttpFileArg(fileFormValues)); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java index ef1def69c0..cd92efddab 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/parser/jmeter/body/MsWWWFormBodyConverter.java @@ -16,7 +16,10 @@ public class MsWWWFormBodyConverter extends MsBodyConverter { @Override public void parse(HTTPSamplerProxy sampler, WWWFormBody body, ParameterConfig config) { List formValues = body.getFormValues(); - List validFormValues = formValues.stream().filter(WWWFormKV::isValid).collect(Collectors.toList()); + List validFormValues = formValues.stream() + .filter(WWWFormKV::getEnable) + .filter(WWWFormKV::isValid) + .collect(Collectors.toList()); sampler.setArguments(getArguments(validFormValues)); } }