0
새 사용자 생성을위한 Gatling 스크립트를 만들고 있습니다. 사용자 정의 값 (fName = "newuser", emailDomain = "@ perftestorg.com")을 다음 요청으로 전달합니다.Gatling : 사용자 정의 변수 (값)를 스칼라 스크립트로 전달하는 방법은 무엇입니까?
그러나 응답으로 정의 된 값을 반환하지 않았고 타임 스탬프도 인쇄되지 않았습니다. 내가 여기서 뭘 잘못하고 있는지 제안 해주세요.
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
import java.util.Calendar
import java.util.Date
import java.text.SimpleDateFormat
class CreateNewUser extends Simulation {
val fName = "newuser"
val emailDomain = "@perftestorg.com"
val sdfDate = new SimpleDateFormat("ddMMyy.HH.mm.ss.SSS")
val now = new Date()
val timeStamp = sdfDate.format(now)
val httpProtocol = http
.baseURL("https://abcxyz.com")
.acceptHeader("application/json, text/javascript, */*; q=0.01")
.acceptEncodingHeader("gzip, deflate")
.acceptLanguageHeader("en-US")
.userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")
.disableCaching
.doNotTrackHeader("1")
val scn = scenario("CreateNewUser")
.exec(http("LogIn")
.post("https://" + uri1 + "/login-page")
.headers(headers_0)
.formParam("_58_redirect", "")
.formParam("_58_rememberMe", "false")
.formParam("_58_login", "[email protected]")
.formParam("_58_password", "scOrpiO")
.exec(http("checkUserAlreadyExist")
.post("/api/checkUserAlreadyExist")
.headers(headers_2)
.formParam("emailAdd", "$fName+timeStamp+$emailDomain"))
.exec(http("CreateNewUser")
.post("/api/UserSubscription")
.headers(headers_2)
.formParam("UserSubscription", """{"userEmail":"$fName+timeStamp+$emailDomain", "fName":"$fName","lName":""""+timeStamp+"""","languageId":"en_GB","subscription_id":"1","contractNumber":"1234567890","emailNotification":true,"orgName":"Performance Testing Organisation"}""")
.formParam("sendLoginCredential", "true"))
setUp(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
}
귀하의 도움을 많이 주시면 감사하겠습니다. 당신이 $ FNAME으로 뭔가를 사용하는 경우
덕분에, 프라 빈
질문 : 스칼라 스크립트입니다 무엇 –
@SarveshKumarSingh 답변 : 개틀링입니다 스크립트 개발을 위해 스칼라 프로그래밍을 사용하는 성능 테스트 도구. – Praveen