我已将所有selenium脚本与Jmeter集成,方法是将selenium脚本导出到jar文件中并放入%Jmeter_Home%/ lib / junit文件夹但是当我尝试使用JUnit Request Sampler在Jmeter中执行这些脚本时,它显示错误:< / p>
2017-07-19 18:34:55,433 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2017-07-19 18:34:55,433 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2017-07-19 18:34:55,435 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2017-07-19 18:34:55,637 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2017-07-19 18:34:55,637 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2017-07-19 18:34:55,637 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2017-07-19 18:34:55,637 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2017-07-19 18:34:55,638 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2017-07-19 18:34:55,638 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2017-07-19 18:34:55,640 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2017-07-19 18:34:55,640 INFO o.a.j.p.j.s.JUnitSampler: Trying to find constructor with one String parameter returned error: Test_Scripts.testLogIn.<init>(java.lang.String)
2017-07-19 18:34:55,643 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2017-07-19 18:34:55,643 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2017-07-19 18:34:55,643 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-07-19 18:34:55,643 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
答案 0 :(得分:0)
Selenium dependencies中是否有相关的JMeter classpath?如果没有,请注意您需要将它们与.jar一起提供,因为JMeter不随任何Selenium库一起提供。另请注意,JMeter重启需要选择.jars。
在绝大多数情况下,WebDriver Sampler更容易使用。可以使用JMeter Plugins Manager
安装它(包括依赖项)