如何解决Gatling.bat命令行选项,它们如何工作?
当我根据Gatling网站将命令行选项“ -simulation”添加到“ gatling.bat”文件时,该文件是“ gatling-charts-highcharts-bundle-3.3.1”下载的一部分。 我收到一条错误消息:“警告:未知选项-模拟”
我不明白为什么?
我正在使用Visual Studio代码并在Powershell终端窗口中运行“ gatling.bat”。 如果我不放置任何命令行选项,它将按预期运行。
这是我的一些代码和galtting网站屏幕截图
加特林网站Screensots
我的模拟代码
请注意,类名是“ AllTests”
package api
//Import API Object's to include in test
import api1.{foo => foofoo}
import api2.{bar => barbar}
//Gatling and Scala imports
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import java.util.concurrent.ThreadLocalRandom
import com.typesafe.config._
class AllTests extends Simulation {
/*
val conf = ConfigFactory.load("application.conf");
val baseUrl = conf.getString("base-app.baseurl")
*/
val httpProtocol = http
.baseUrl("https://api.accp.qqq/")
.header("Sec-Fetch-Site","same-origin")
.header("Sec-Fetch-Mode","cors")
.header("Sec-Fetch-Dest","empty")
.acceptHeader("application/json")
.acceptLanguageHeader("en-US,en;q=0.9")
.acceptEncodingHeader("gzip,deflate,br")
.userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/86.0.4240.75 Safari/537.36 Edg/86.0.622.38")
setUp(
foofoo.users.inject(atOnceUsers(1)),barbar.users.inject(atOnceUsers(1))
).protocols(httpProtocol)
}
这是带有命令行选项的“ gatling.bat”
注意警告
C:\Users\xxx\source\perfrepo\Test01\bin> .\gatling.bat -simulation AllTests
GATLING_HOME is set to "C:\Users\xxx\source\perfrepo\Test01"
JAVA = ""C:\Program Files\Java\jdk-11.0.2\bin\java.exe""
Warning: Unknown option -simulation
Warning: Unknown argument 'AllTests'
Choose a simulation number:
[0] computerdatabase.advanced.AdvancedSimulationStep01
[1] computerdatabase.advanced.AdvancedSimulationStep02
[2] computerdatabase.advanced.AdvancedSimulationStep03
[3] computerdatabase.advanced.AdvancedSimulationStep04
[4] computerdatabase.advanced.AdvancedSimulationStep05
[5] api.AllTests
解决方法
这是我们文档生成中的一个错误,其中--
(双破折号)被转换为单个(参见doc sources)。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。