Jmeter-Selenium / Webdriver支持:HTMLUNIT驱动程序错误

时间:2019-01-02 13:05:41

标签: selenium-webdriver jmeter htmlunit-driver

java.lang.IllegalArgumentException: Browser name must be htmlunit
at org.openqa.selenium.htmlunit.HtmlUnitDriver.determineBrowserVersion(HtmlUnitDriver.java:315) ~[htmlunit-driver-2.33.0.jar:?]
at org.openqa.selenium.htmlunit.HtmlUnitDriver.<init>(HtmlUnitDriver.java:280) ~[htmlunit-driver-2.33.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.HtmlUnitDriverConfig.createBrowser(HtmlUnitDriverConfig.java:21) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.HtmlUnitDriverConfig.createBrowser(HtmlUnitDriverConfig.java:8) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220) ~[jmeter-plugins-webdriver-3.0.jar:?]
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:676) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:4.0 r1823414]
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:4.0 r1823414]
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:644) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:632) [ApacheJMeter_core.jar:4.0 r1823414]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:246) [ApacheJMeter_core.jar:4.0 r1823414]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]

2019-01-02 18:32:20,251错误o.a.j.t.JMeterThread:处理采样器时出错:'jp @ gc-WebDriver采样器'。 java.lang.IllegalArgumentException:未配置浏览器。请确保至少为一个线程组创建1个WebDriverConfig。     在com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:62)〜[jmeter-plugins-webdriver-3.0.jar :?]     在org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)〜[ApacheJMeter_core.jar:4.0 r1823414]     在org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)[ApacheJMeter_core.jar:4.0 r1823414]     在org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)上[ApacheJMeter_core.jar:4.0 r1823414]     在java.lang.Thread.run(Thread.java:748)[?:1.8.0_181] 2019-01-02 18:32:20,251 INFO o.a.j.t.JMeterThread:线程已完成:线程组1-1 2019-01-02 18:32:20,252 INFO o.a.j.t.JMeterThread:线程完成:线程组1-1 2019-01-02 18:32:20,252 INFO o.a.j.e.StandardJMeterEngine:通知测试监听器测试结束 2019-01-02 18:32:20,253 INFO o.a.j.g.u.JMeterMenuBar:setRunning(false, local

1 个答案:

答案 0 :(得分:0)

这听起来像是WebDriver Sampler中的错误,我建议您联系JMeter Plugins developers/maintainers并在此报告问题。


还请注意,according to JMeter Best Practices you should always use the latest JMeter version因此请考虑在下一个可用机会迁移到JMeter 5.0(或JMeter Downloads页上可用的最新版本)。