Web采样器(Jmeter)的Fire Fox配置不起作用

时间:2019-07-12 08:58:32

标签: performance firefox jmeter

请帮助。我的jmeter Web驱动程序采样器无法正常工作。我正在使用firefox配置。

2019-07-12 20:55:38,913 ERROR o.a.j.t.JMeterThread: Error calling threadStarted
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
    at com.google.common.base.Preconditions.checkState(Preconditions.java:843) ~[guava-28.0.jar:?]
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:125) ~[selenium-remote-driver-3.14.0.jar:?]
    at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:43) ~[selenium-firefox-driver-3.14.0.jar:?]
    at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:168) ~[selenium-firefox-driver-3.14.0.jar:?]
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:346) ~[selenium-remote-driver-3.14.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:99) ~[jmeter-plugins-webdriver-3.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:22) ~[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:762) [ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:5.1.1 r1855137]
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:730) [ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:718) [ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249) [ApacheJMeter_core.jar:5.1.1 r1855137]
    at java.lang.Thread.run(Thread.java:835) [?:?]

1 个答案:

答案 0 :(得分:0)

  

驱动程序可执行文件的路径必须由webdriver.gecko.driver系统属性设置;

您需要:

  1. 下载geckodriver
  2. 定义webdriver.gecko.driver Java system property。对于JMeter,可以通过两种方式完成:

    • 通过-D命令行参数传递geckodriver二进制文件的位置:

      jmeter -Dwebdriver.gecko.driver=/path/to/geckodriver.binary
      
    • ,或者如果要永久保留更改-将下一行添加到 system.properties 文件(位于JMeter安装目录的“ bin”文件夹中)

      webdriver.gecko.driver=/path/to/geckodriver.binary  
      

      需要重新启动JMeter才能拾取属性

参考文献: