我有以下问题。当我试图执行模拟时,我会得到以下错误:
Generating reports...
Exception in thread "main" java.lang.UnsupportedOperationException: There were no requests sent during the simulation, reports won't be generated
at io.gatling.charts.report.ReportsGenerator.generateFor(ReportsGenerator.scala:49)
a
我将Gatling与JDBC feeder结合使用,并希望根据前一个请求的响应向JDBC feeder的where子句动态添加一个参数。下面是我的示例,我正在尝试执行一个post,它将创建一个用户,然后让提要使用从create user请求返回的userId获取用户生成的UUID,然后使用UUID发布一些数据。
val dbConnectionString = "jdbc:mysql://localhost:3306/user"
val sqlQuery = "SELECT user_uuid FROM users where user_id = '${user
我使用gatling中的会话来存储值,如下所示
exec(session => {
val id = Instant.now.toEpochMilli.toString + scala.util.Random.nextInt(1000).toString
session.set("STARTED_PROCESS_ID",id)
//Store the id somewhere for processing later
session
})
.exec(
我对Gatling非常陌生,我需要用它编写自动化脚本。我在这方面没有任何经验。
当我试图运行多个场景时,我在登录后检索一个"session_key“作为JSON响应的一部分。我试图跟随来自互联网的指南,保存这个值,但是当我试图在第二个场景中进一步使用它时,表达式语言找不到它。
我已经验证了我的JSONPath表达式,它似乎是正确的。
{"result":1,"resultType":"ack","output":{"session_key":"a value for the session key
根据,我可以在执行场景时使用会话属性。
但是,每次在场景中使用函数文本访问会话时,我都会遇到以下异常:
[error] java.lang.UnsupportedOperationException: There were no requests sent during the simulation, reports won't be generated
[error] at io.gatling.charts.report.ReportsGenerator$.generateFor(ReportsGenerator.scala:45)
[error] at io.ga
我对Gatling有点陌生,我想从cookie中获得价值。我尝试了很多方法,但我可能会误解一些东西。
首先,我向auth API发出post请求,创建我想要的cookie。
然后我试过了:
.exec {
session => println(session)
println(session.attributes)
// return a Some object whose value is of type CookieJar (with apparently private access)
println(session.attr
I am trying to pass the session ArrayBuffer element to exec http method directly . However this exec http is getting called at all.
Session output is below :
Session(6UsersAtOnce,6,1606715840791,Map(gatling.http.cache.baseUrl -> https://dbp-services-gateway-dk0859-a.uki1f.paas.in
我每次都需要创建一个随机的正整数,并将其发送到Gatling中的Json body。
我使用下面的代码创建了一个随机的正ineger:
val r = new scala.util.Random;
val OrderRef = r.nextInt(Integer.MAX_VALUE);
但是,如何将随机生成的值提供给json主体呢?
我试过了:
.exec(http("OrderCreation")
.post("/abc/orders")
.body(StringBody("""{ "orderReference"