是否可以在 xpath 断言中使用 jmeter 变量?

Sea*_*ean 1 xpath jmeter

我在 jmeter 测试套件中使用 xpath 断言,但在处理我收到的响应中的动态内容时遇到问题。有没有办法使用我在 xpath 断言中定义的 jmeter 变量?我试过这个,但它不起作用。

/response/body/locationReports/locationReport[@deviceHandle = ${deviceHandle}]
Run Code Online (Sandbox Code Playgroud)

Sea*_*ean 6

刚刚发现它的工作原理是在变量名周围添加单引号,如下所示

/response/body/locationReports/locationReport[@deviceHandle = '${deviceHandle}']
Run Code Online (Sandbox Code Playgroud)