Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从java代码运行gatling测试,并通过模拟参数中的测试url?_Java_Spring Boot_Maven_Gatling_Scala Gatling - Fatal编程技术网

如何从java代码运行gatling测试,并通过模拟参数中的测试url?

如何从java代码运行gatling测试,并通过模拟参数中的测试url?,java,spring-boot,maven,gatling,scala-gatling,Java,Spring Boot,Maven,Gatling,Scala Gatling,我希望能够从java代码向Gatling模拟传递参数,特别是测试的url。我使用了Gatling和maven方法。请帮帮我。一种方法是: 例如,我需要通过测试下的URL 要在scala代码中选取此变量,请执行以下操作: val foo_url = System.getProperty("foo") 要在模拟中使用此foo_url: val httpProtocol = http //.baseUrl("http://127.0.0.1:5000"

我希望能够从java代码向Gatling模拟传递参数,特别是测试的url。我使用了Gatling和maven方法。请帮帮我。

一种方法是: 例如,我需要通过测试下的URL

要在scala代码中选取此变量,请执行以下操作:

val foo_url = System.getProperty("foo")
要在模拟中使用此foo_url:

val httpProtocol = http
    //.baseUrl("http://127.0.0.1:5000")
    .baseUrl(foo_url)

我可以知道你收到的错误吗?如果可能的话,还有一个关于代码外观的代码片段。感谢它现在可以工作了。我的错误是将URL设置在“”和“”之间
val httpProtocol = http
    //.baseUrl("http://127.0.0.1:5000")
    .baseUrl(foo_url)