JMeter:预期的浏览器二进制文件位置,但无法在默认位置找到二进制文件,没有提供'moz:firefoxOptions.binary'功能

mm9b1k5b  于 2023-10-20  发布在  其他
关注(0)|答案(1)|浏览(126)

需要帮助,因为我试图在公司机器上使用JMeter 5.6.2和Firefox驱动程序配置创建性能方案,但我收到错误消息:

  • org.openqa.selenium.SessionNotCreatedException:无法启动新会话。响应代码500。消息:预期的浏览器二进制位置,但无法在默认位置找到二进制文件,没有提供'moz:firefoxOptions.binary'功能,命令行上没有设置二进制标志。*
    需要完成的场景:

  • 借助 jp@gc - Firefox Driver Configjp@gc - WebDriver Sampler,使用selenium自动化Microsoft登录页面
    密码:

  • JMeter版本:5.6.2

  • Selenium-api版本:4.10

  • Geko驱动程序版本:V0.33.0 - X64

  • 插件管理器已安装

  • 已安装“jp@gc - Firefox Driver Config”和“jp@gc - WebDriver Sampler”

  • Firefox浏览器安装版本:117.0.1(64位)

  • Firefox安装路径:C:\Username\AppData\Local\Mozilla Firefox

    • 注意:我注意到能够更改browser.exe位置为默认值或更改系统变量,因为它是一台公司机器,我没有管理员角色**
      ***使用以下命令编辑JMeter系统属性文件以添加Divers路径:webdriver.gecko.driver= C:/Users/username/Downloads/DriverLatest/geckodriver.exe
      详细错误
  • 驱动程序信息:org. openqa. selenium. firefox. FirefoxDriver命令:[null,newSession {capabilities =[Capabilities {acceptInsecureCerts:false,browserName:firefox,moz:debugger地址:true,moz:firefox选项:{profile:UEsDBBQACAgIAI5QNlcAAAAAAAA.},proxy:代理(系统)}]}]在org. openqa. selenium. remote. ProtocolHandshake. OpenSession(ProtocolHandshake.java:140)~[selenium-remote-driver-4.10.0.jar:?] at org. openqa. selenium. remote. ProtocolHandshake. socket Session(ProtocolHandshake.java:96)~[selenium-remote-driver-4.10.0.jar:?] at org. openqa. selenium. remote. ProtocolHandshake. socket Session(ProtocolHandshake.java:68)~[selenium-remote-driver-4.10.0.jar:?] at org. openqa. selenium. remote. HttpCommandExecutor. execute(HttpCommandExecutor.java:163)~[selenium-remote-driver-4.10.0.jar:?] at org. openqa. selenium. remote. service. DriverCommandExecutor. invokeExecute(DriverCommandExecutor.java:196)~[selenium-remote-driver-4.10.0.jar:?] at org. openqa. selenium. remote. service. DriverCommandExecutor. execute(DriverCommandExecutor.java:171)~[selenium-remote-driver-4.10.0.jar:?] at org. openqa. selenium. remote. RemoteWebDriver. execute(RemoteWebDriver.java:531)~[selenium-remote-driver-4.10.0.jar:?] at org. openqa. selenium. remote. RemoteWebDriver. startSession(RemoteWebDriver.java:227)~[selenium-remote-driver-4.10.0.jar:?] at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:154)~[selenium-remote-driver-4.10.0.jar:?] at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:151)~[selenium-firefox-driver-4.10.0.jar:?] at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:146)~[selenium-firefox-driver-4.10.0.jar:?] at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:130)~[selenium-firefox-driver-4.10.0.jar:?] at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:125)~[selenium-firefox-driver-4.10.0.jar:?] at com. googlecode. jmeter. plugins. webdriver. config. FirefoxDriverConfig. Firefox浏览器(FirefoxDriverConfig.java:36)~[jmeter-plugins-webdriver-4.10.0.0.jar:?] at com. googlecode. jmeter. plugins. webdriver. config. FirefoxDriverConfig. Firefox浏览器(FirefoxDriverConfig.java:15)~[jmeter-plugins-webdriver-4.10.0.0.jar:?] at com. googlecode. jmeter. plugins. webdriver. config. WebDriverConfig. getPreparedBrowser(WebDriverConfig.java:221)~[jmeter-plugins-webdriver-4.10.0.0.jar:?] at com. googlecode. jmeter. plugins. webdriver. config. WebDriverConfig. threadStarted(WebDriverConfig.java:152)~[jmeter-plugins-webdriver-4.10.0.0.jar:?]在org.Apachejmeter。线程。JMeterThread $ThreadListenerTraverser。addNode(JMeterThread.java:802)[ApacheJMeter_core. jar:5.6.2] at org.Apache约翰。收藏品。哈希树HashTree.java:1029)[jorphan. jar:5.6.2] at org.Apache约翰。收藏品。哈希树transverse(HashTree.java:1012)[jorphan. jar:5.6.2] at org.Apachejmeter。线程。JMeterThread。threadStarted(JMeterThread.java:770)[ApacheJMeter_core. jar:5.6.2] at org.Apachejmeter。线程。JMeterThread。initRun(JMeterThread.java:758)[ApacheJMeter_core. jar:5.6.2]在www.example.com(JMeterThread.java:264)[ApacheJMeter_core. jar:5.6.2]在www.example.com(未知来源)[?org.apache.jmeter.threads.JMeterThread.run处理采样器时出错:java.lang.Thread.runjava. lang. IllegalArgumentException:浏览器尚未配置。请确保至少为一个ThreadGroup创建1个WebDriverConfig。在com. googlecode. jmeter. plugins. webdriver. sampler. WebDriverSampler. sample(WebDriverSampler. java:65)~[jmeter-plugins-webdriver-4.10.0.0.jar:?]在org.Apachejmeter。线程。JMeterThread。doSampling(JMeterThread.java:651)~[ApacheJMeter_core. jar:5.6.2] at org.Apachejmeter。线程。JMeterThread。executeSamplePackage(JMeterThread.java:570)~[ApacheJMeter_core. jar:5.6.2] at org.Apachejmeter。线程。JMeterThread。processSampler(JMeterThread.java:501)[ApacheJMeter_core. jar:5.6.2]在www.example.com(JMeterThread.java:268)[ApacheJMeter_core. jar:5.6.2]在www.example.com(未知来源)[?:1.8.0_351]*

n6lpvg4x

n6lpvg4x1#

Selenium找不到Firefox
您应该:
1.在Firefox Driver Config中设置geckodriver的路径

1.通过JMeter的system.properties file中的webdriver.firefox.bin属性设置Firefox可执行文件的完整路径,如:

webdriver.firefox.bin="C:\Users\username\AppData\Local\Mozilla Firefox\\firefox.exe"

注意以下事项:
1.不建议使用Selenium进行性能测试by Selenium developers
通常不建议使用Selenium和WebDriver进行性能测试。不是因为它没有能力,而是因为它没有为工作进行优化,你不太可能得到好的结果。

  1. WebDriver Sampler开发人员不建议使用Selenium进行性能测试
    注意:本项目无意替换JMeter中包含的HTTP采样器。相反,它是为了通过测量最终用户加载时间来补充它们。
    因此,使用JMeter的HTTP请求采样器实现登录可能是一个更好的主意

相关问题