Gatling 脚本编译错误说值 'check' 不是成员
Gatling script compilation error saying value 'check' is not a member
我在加特林用户脚本中有一个方法,如下所示。
此脚本是用 gatling 2.3 编写的。
def registerAddress: ChainBuilder = {
exec(ws("WS Register Address").wsName(id)
.sendText(prefetchAddress)
.check(wsAwait.within(30).until(1).regex("success").exists))
.exec(ping)
}
我正在将其转换为 gatling 3.0,当我尝试 运行 时,出现以下错误。
value check is not a member of io.gatling.http.action.ws.WsSendTextFrameBuilder
我到处搜索,但找不到与 WsSendTextFrameBuilder
class 相关的文档来相应地更改方法调用。
有谁知道与此相关的文档class或解决此问题的方法?
谢谢。
在阅读了 Gatling 2.3 和 3.0 的文档后,我发现了上述场景的新调用。
显然 check
方法在 WsSendTextFrameBuilder
class 中不再可用。
而不是应该使用 await
方法。
所以代码看起来类似于下面。
val checkReply = ws.checkTextMessage("request").check(regex("request-complete"))
def registerAddress: ChainBuilder = {
exec(ws("WS Register Address").wsName(id)
.sendText(prefetchAddress)
.await(30 seconds)(checkReply))
.exec(ping)
}
我在加特林用户脚本中有一个方法,如下所示。 此脚本是用 gatling 2.3 编写的。
def registerAddress: ChainBuilder = {
exec(ws("WS Register Address").wsName(id)
.sendText(prefetchAddress)
.check(wsAwait.within(30).until(1).regex("success").exists))
.exec(ping)
}
我正在将其转换为 gatling 3.0,当我尝试 运行 时,出现以下错误。
value check is not a member of io.gatling.http.action.ws.WsSendTextFrameBuilder
我到处搜索,但找不到与 WsSendTextFrameBuilder
class 相关的文档来相应地更改方法调用。
有谁知道与此相关的文档class或解决此问题的方法?
谢谢。
在阅读了 Gatling 2.3 和 3.0 的文档后,我发现了上述场景的新调用。
显然 check
方法在 WsSendTextFrameBuilder
class 中不再可用。
而不是应该使用 await
方法。
所以代码看起来类似于下面。
val checkReply = ws.checkTextMessage("request").check(regex("request-complete"))
def registerAddress: ChainBuilder = {
exec(ws("WS Register Address").wsName(id)
.sendText(prefetchAddress)
.await(30 seconds)(checkReply))
.exec(ping)
}