我想知道在哪种情况下我可以使用"主样本"或"子样本"或两者同时用于响应断言中的文本响应.
我用谷歌搜索了它,但还没有得到满意的答案.
帮助赞赏.
根据JMeter帮助,
This is for use with samplers that can generate sub-samples, e.g. HTTP Sampler with embedded resources, Mail Reader or samples generated by the Transaction Controller.
Main sample only - assertion only applies to the main sample
Sub-samples only - assertion only applies to the sub-samples
Main sample and sub-samples - assertion applies to both.
JMeter Variable - assertion is to be applied to the contents of the named variable
Run Code Online (Sandbox Code Playgroud)
在大多数情况下,只有主采样器具有所有必需的响应数据,但是现在由于ajax,jquery框架单个请求可以在内部产生多个子请求,并且每个请求都有其响应数据.
因此,在大多数情况下,搜索主要采样器的响应就足够了


但是如果您知道或者您发现该请求有多个子请求并且响应可以在任何地方,那么您可以选择"主样本和子样本"单选按钮,这样您就不会错过子请求.
