我需要一个例子迪诺如何使用空手道脚本性能测试使用Gatling从头开始 [英] Need one example deno on how to use karate scripts for peformance testing using gatling from scratch
本文介绍了我需要一个例子迪诺如何使用空手道脚本性能测试使用Gatling从头开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对性能测试非常陌生,我浏览了使用Gatling中的空手道脚本创建的示例项目,但无法理解如何进行测试,
谁能解释一下如何使用下面的公共API使用空手道进行Gatling性能测试
场景:获取状态特定信息-一个状态
给定的url‘http://services.groupkt.com/state/get/IND/AP’ 当方法获取 然后是状态200 *def resp=响应.RestResponse.Result.name *打印回复以便我们可以在我们的项目中使用它。无法理解GitHub空手道中当前可用的演示项目
推荐答案
您只需使用Git克隆并运行这个简单的独立项目:https://github.com/ptrthomas/karate-gatling-demo
如果需要,请寻求熟悉Maven项目的人的帮助。
运行此程序后,您将能够立即了解和修改此程序。
package mock
import com.intuit.karate.gatling.PreDef._
import io.gatling.core.Predef._
import scala.concurrent.duration._
class CatsSimulation extends Simulation {
val protocol = karateProtocol(
"/cats/{id}" -> Nil,
"/cats" -> Nil
)
val create = scenario("create").exec(karateFeature("classpath:mock/cats-create.feature"))
val delete = scenario("delete").exec(karateFeature("classpath:mock/cats-delete.feature"))
setUp(
create.inject(rampUsers(10) over (5 seconds)).protocols(protocol),
delete.inject(rampUsers(5) over (5 seconds)).protocols(protocol)
)
}
这篇关于我需要一个例子迪诺如何使用空手道脚本性能测试使用Gatling从头开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文