我是JMeter的新手。
在我的测试计划中,我使用
我正在使用BeanShell断言来比较实际FK_SiteId与预期FK_SiteId,如下所示。
请在下面找到错误消息。
2019-03-04 12:25:45,549 INFO o.a.j.e.StandardJMeterEngine: Running the test! 2019-03-04 12:25:45,549 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2019-03-04 12:25:45,549 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2019-03-04 12:25:45,661 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : SQL Database Connection 2019-03-04 12:25:45,661 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group SQL Database Connection.
2019-03-04 12:25:45,661 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-03-04 12:25:45,661 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2019-03-04 12:25:45,677 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2019-03-04 12:25:45,677 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2019-03-04 12:25:45,677 INFO o.a.j.t.JMeterThread: Thread started: SQL Database Connection 1-1
2019-03-04 12:25:50,564 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult = "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 WARN o.a.j.a.BeanShellAssertion: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult = "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult = "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 WARN o.a.j.a.BeanShellAssertion: org.apache.jorphan.util.JMeterException: Error invoking bsh method: eval Sourced file: inline evaluation of: ``String ActialResult = vars.get(${FK_SiteId}); String ExpectedResult
= "14001"; . . . '' : Typed variable declaration : Attempt to access property on undefined variable or class name
2019-03-04 12:25:50,564 INFO o.a.j.t.JMeterThread: Thread is done: SQL Database Connection 1-1
2019-03-04 12:25:50,564 INFO o.a.j.t.JMeterThread: Thread finished: SQL Database Connection 1-1
2019-03-04 12:25:50,564 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-03-04 12:25:50,564 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
谁能告诉我我要去哪里了
答案 0 :(得分:0)
您的变量已保存为FK_SiteId_1。您可以通过以下方式访问此变量:
vars.get("FK_SiteId_1")
或直接${FK_SiteId_1}
使用log.info(...
检查变量值
我更喜欢使用vars.get解决方案。