JMeter Firefox驱动程序配置无法启动浏览器

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

标签: jmeter jmeter-plugins selenium-firefoxdriver

我正在尝试使用JMeter的FireFox驱动程序配置,以便可以使用Web驱动程序采样器等待页面处理内部的自动OAuth流程以重定向页面,但是我遇到了JMeter加载Firefox的问题。

为此打印的唯一错误是Failed to connect binary FirefoxBinary,但我了解的附加信息为零。

实际上,关于如何在JMeter中使用Firefox Driver Config的每个教程,我还需要采取哪些其他步骤?

org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/Applications/Firefox.app/Contents/MacOS/firefox-bin) on port 7055; process output follows: 
":null,"translators":null,"contributors":null,"locales":["fa"]},{"name":"Wikipedia (or)","description":"ୱିକିପିଡ଼ିଆ  (ଓଡ଼ିଆ)","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["or"]},{"name":"വിക്കിപീഡിയ (ml)","description":"വിക്കിപീഡിയ, സ്വതന്ത്ര സര്‍വ്വവിജ്ഞാനകോശം ","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ml"]},{"name":"Wikipedia (ia)","description":"Wikipedia, le encyclopedia libere","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ia"]},{"name":"Wikipedia (ms)","description":"Wikipedia, ensiklopedia bebas","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ms"]},{"name":"Wikipedia (no)","description":"Wikipedia, den frie encyklopedi","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["NO"]},{"name":"Википедия (ru)","description":"Википедия, свободная энциклопедия","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ru"]},{"name":"Wikipedia (br)","description":"Wikipedia, an holloueziadur digor","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["br"]},{"name":"Wikipedia (pl)","description":"Wikipedia, wolna encyklopedia","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["pl"]},{"name":"ວິກິພີເດຍ (lo)","description":"ວິກິພີເດຍ, ສາລານຸກົມເສລີ","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["lo"]},{"name":"Wikipedija (sl)","description":"Wikipedija, prosta enciklopedija","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["sl"]},{"name":"Vikipēdija","description":"Vikipēdija, brīvā enciklopēdija","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["lv"]},{"name":"Wikipedia (sv)","description":"Wikipedia, den fria encyklopedin","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["sv-SE"]},{"name":"Вікіпэдыя (be-tarask)","description":"Вікіпэдыя, вольная энцыкляпэдыя","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["be-tarask"]},{"name":"Biquipedia (an)","description":"A enciclopedia Libre","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["an"]}],"targetApplications":[{"id":"toolkit@mozilla.org","minVersion":null,"maxVersion":null}],"targetPlatforms":[],"seen":true,"dependencies":[],"incognito":"spanning","userPermissions":{"permissions":[],"origins":[]},"icons":{"16":"favicon.ico"},"iconURL":null,"blocklistState":0,"blocklistURL":null,"startupData":null,"hidden":true,"installTelemetryInfo":null,"recommendationState":null,"rootURI":"resource://search-extensions/wikipedia/","location":"app-builtin"}
1565650376116   addons.xpi  DEBUG   Loading bootstrap scope from resource://search-extensions/wikipedia/
1565650376116   addons.xpi  DEBUG   Calling bootstrap method install on wikipedia@search.mozilla.org version 1.0
1565650376116   addons.xpi  DEBUG   Calling bootstrap method startup on wikipedia@search.mozilla.org version 1.0
1565650395862   addons.productaddons    INFO    sending request to: https://aus5.mozilla.org/update/3/GMP/68.0.1/20190717172542/Darwin_x86_64-gcc3/en-US/release/Darwin%2018.7.0/default/default/update.xml
1565650395943   addons.productaddons    INFO    Completed downloading document
1565650396315   addons.productaddons    INFO    downloadXHR File download. status=200
1565650396318   addons.productaddons    INFO    Downloaded file will be saved to /var/folders/3s/qk2pg7q16m5056kjfvgkqk4c0000gn/T/tmpaddon-f9b30e
1565650396811   addons.productaddons    INFO    downloadXHR File download. status=200
1565650396814   addons.productaddons    INFO    Downloaded file will be saved to /var/folders/3s/qk2pg7q16m5056kjfvgkqk4c0000gn/T/tmpaddon-26509c

Build info: version: '2.52.0', revision: '4c2593cfc3689a7fcd7be52549167e5ccc93ad28', time: '2016-02-11 11:22:43'
System info: host: 'Tanner-Devetry-Mac.local', ip: '192.168.231.124', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_191'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:125) ~[selenium-firefox-driver-2.52.0.jar:?]
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271) ~[selenium-firefox-driver-2.52.0.jar:?]
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119) ~[selenium-remote-driver-2.52.0.jar:?]
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216) ~[selenium-firefox-driver-2.52.0.jar:?]
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211) ~[selenium-firefox-driver-2.52.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:100) ~[JMeterPlugins-WebDriver.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:21) ~[JMeterPlugins-WebDriver.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233) ~[JMeterPlugins-WebDriver.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220) ~[JMeterPlugins-WebDriver.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.traverseInto(HashTree.java:995) [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:748) [?:1.8.0_191]
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
":null,"translators":null,"contributors":null,"locales":["fa"]},{"name":"Wikipedia (or)","description":"ୱିକିପିଡ଼ିଆ  (ଓଡ଼ିଆ)","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["or"]},{"name":"വിക്കിപീഡിയ (ml)","description":"വിക്കിപീഡിയ, സ്വതന്ത്ര സര്‍വ്വവിജ്ഞാനകോശം ","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ml"]},{"name":"Wikipedia (ia)","description":"Wikipedia, le encyclopedia libere","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ia"]},{"name":"Wikipedia (ms)","description":"Wikipedia, ensiklopedia bebas","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ms"]},{"name":"Wikipedia (no)","description":"Wikipedia, den frie encyklopedi","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["NO"]},{"name":"Википедия (ru)","description":"Википедия, свободная энциклопедия","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["ru"]},{"name":"Wikipedia (br)","description":"Wikipedia, an holloueziadur digor","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["br"]},{"name":"Wikipedia (pl)","description":"Wikipedia, wolna encyklopedia","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["pl"]},{"name":"ວິກິພີເດຍ (lo)","description":"ວິກິພີເດຍ, ສາລານຸກົມເສລີ","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["lo"]},{"name":"Wikipedija (sl)","description":"Wikipedija, prosta enciklopedija","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["sl"]},{"name":"Vikipēdija","description":"Vikipēdija, brīvā enciklopēdija","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["lv"]},{"name":"Wikipedia (sv)","description":"Wikipedia, den fria encyklopedin","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["sv-SE"]},{"name":"Вікіпэдыя (be-tarask)","description":"Вікіпэдыя, вольная энцыкляпэдыя","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["be-tarask"]},{"name":"Biquipedia (an)","description":"A enciclopedia Libre","creator":null,"developers":null,"translators":null,"contributors":null,"locales":["an"]}],"targetApplications":[{"id":"toolkit@mozilla.org","minVersion":null,"maxVersion":null}],"targetPlatforms":[],"seen":true,"dependencies":[],"incognito":"spanning","userPermissions":{"permissions":[],"origins":[]},"icons":{"16":"favicon.ico"},"iconURL":null,"blocklistState":0,"blocklistURL":null,"startupData":null,"hidden":true,"installTelemetryInfo":null,"recommendationState":null,"rootURI":"resource://search-extensions/wikipedia/","location":"app-builtin"}
1565650376116   addons.xpi  DEBUG   Loading bootstrap scope from resource://search-extensions/wikipedia/
1565650376116   addons.xpi  DEBUG   Calling bootstrap method install on wikipedia@search.mozilla.org version 1.0
1565650376116   addons.xpi  DEBUG   Calling bootstrap method startup on wikipedia@search.mozilla.org version 1.0
1565650395862   addons.productaddons    INFO    sending request to: https://aus5.mozilla.org/update/3/GMP/68.0.1/20190717172542/Darwin_x86_64-gcc3/en-US/release/Darwin%2018.7.0/default/default/update.xml
1565650395943   addons.productaddons    INFO    Completed downloading document
1565650396315   addons.productaddons    INFO    downloadXHR File download. status=200
1565650396318   addons.productaddons    INFO    Downloaded file will be saved to /var/folders/3s/qk2pg7q16m5056kjfvgkqk4c0000gn/T/tmpaddon-f9b30e
1565650396811   addons.productaddons    INFO    downloadXHR File download. status=200
1565650396814   addons.productaddons    INFO    Downloaded file will be saved to /var/folders/3s/qk2pg7q16m5056kjfvgkqk4c0000gn/T/tmpaddon-26509c

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113) ~[selenium-firefox-driver-2.52.0.jar:?]
    ... 16 more
2019-08-12 16:53:41,118 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'jp@gc - Web Driver Sampler - Perform OAuth'.
java.lang.IllegalArgumentException: Browser has not been configured.  Please ensure at least 1 WebDriverConfig is created for a ThreadGroup.
    at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:52) ~[JMeterPlugins-WebDriver.jar:?]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.1.1 r1855137]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.1.1 r1855137]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
2019-08-12 16:53:42,339 INFO o.a.j.t.JMeterThread: Thread is done: ThreadGroup 1-1
2019-08-12 16:53:42,339 INFO o.a.j.t.JMeterThread: Thread finished: ThreadGroup 1-1
2019-08-12 16:53:42,339 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-08-12 16:53:42,339 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

更新

我继续尝试使用Firefox 26,但是现在我得到的帮助更少了。

以下是我的环境的详细信息: JMeter:5.1.1 Firefox:26.0 Selenium / WebDriver套件:2.52.0

这是我现在遇到的错误:

2019-08-13 11:52:06,427 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2019-08-13 11:52:06,428 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2019-08-13 11:52:06,432 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2019-08-13 11:52:06,557 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2019-08-13 11:52:06,558 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2019-08-13 11:52:06,558 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2019-08-13 11:52:06,558 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2019-08-13 11:52:06,560 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2019-08-13 11:52:06,560 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2019-08-13 11:52:06,560 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2019-08-13 11:52:06,561 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2019-08-13 11:52:06,561 ERROR o.a.j.JMeter: Uncaught exception: 
java.lang.NoClassDefFoundError: org/openqa/selenium/firefox/FirefoxOptions
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:97) ~[jmeter-plugins-webdriver-3.1.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:22) ~[jmeter-plugins-webdriver-3.1.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233) ~[jmeter-plugins-webdriver-3.1.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220) ~[jmeter-plugins-webdriver-3.1.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:748) [?:1.8.0_191]
2019-08-13 11:52:06,562 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2019-08-13 11:52:06,562 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

这是我根据BlazeMeter的tutorial在2019年4月更新的设置:

Firefox Driver Config

WebDriver Sampler

要让Jmeter运行这些测试,我还需要做什么???如果有最新的文档并解释了所有要求,那就太好了。

1 个答案:

答案 0 :(得分:0)

查看您的输出:

  

版本信息:版本:“ 2.52.0”,

根据Selenium Changelog,您可以与此版本Selenium Firefox Driver 2.52.0一起使用Firefox 46或更早版本,因此可以考虑将Firefox降级为Firefox 46或升级到最新版本的WebDriver Sampler Plugin,{截至目前,{3}},您将可以通过version 3.1使用现代Firefoxen。

您可以安装新的JMeter插件,并使用GeckoDriver

使旧的插件保持最新。
相关问题