Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.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
Regex gatling jsonPath部分字符串匹配_Regex_Scala_Performance Testing_Gatling - Fatal编程技术网

Regex gatling jsonPath部分字符串匹配

Regex gatling jsonPath部分字符串匹配,regex,scala,performance-testing,gatling,Regex,Scala,Performance Testing,Gatling,我的完整代码如下所示 val TC04 = feed(accountNumberFeeder04).exec(http(testCase04).post(appendPathToUrl).headers(common_header).body(postPayload).asJSON .check(jsonPath("$..errorMessage").is(errorMessage04)) ) 所以我的HTTP响应有一些动态文本 说bla-bla-bla我的信息中的部分每次都会

我的完整代码如下所示

 val TC04 = feed(accountNumberFeeder04).exec(http(testCase04).post(appendPathToUrl).headers(common_header).body(postPayload).asJSON
    .check(jsonPath("$..errorMessage").is(errorMessage04))
   )
所以我的HTTP响应有一些动态文本

bla-bla-bla
我的信息中的部分每次都会被更改

那么,如何使用gatlingdsl或一些正则表达式匹配部分字符串呢

.check(jsonPath("My error message is bla bla bla ....").is("My error message"))

如果您可以表达正确的jsonPath,但.is()条件限制太大,您可以尝试使用.exists(),它只检查给定jsonPath中的任何内容是否匹配。

请发布更多上下文。这段代码使用什么库?您是否正在使用Play框架进行开发?