Groovy의 그루비 스크립트 연결은 JMeter가에서 선호하는 스크립트입니다JMeter를 - 변수
We advise using Apache Groovy or any language that supports the Compilable interface of JSR223.
JSR233 샘플러에서 다음 코드는 자바에서 작동하지만 그루비의
String a= "0"+"1" +
"2"
+"3";
log.info(a);
내가 +
의 reasons 발견 연산자가 예상대로 작동하지 않습니다.
하지만 해결 방법은 여러 변수를 연결하려는 것입니다. 대본?
In this case, ensure the script does not use any variable using ${varName} as caching would take only first value of ${varName}
String text ="...<id>${id}</id><id2>${id2}</id2>...";
더 나은 무엇 : 또한 not recommended하지만
나는 세 따옴표"""The row Id is: ${row.id}..."""
은 현재 내가 스크립트 언어로 자바를 사용하여 JMeter $ {변수} 사용을 사용하는 답을 사용하는 데 실패 그런 경우 그루비에 접근 하는가?
편집 :
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script12.groovy: 2: unexpected token: << @ line 2, column 1.
<< vars["id2"] << "<id2>";
'''''3 '''에서 이전 줄 끝까지 옮기면 Groovy가 정상적으로 작동합니다. – Andreas