Abanoub Erian
Abanoub Erian

Reputation: 13

JMeter : Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided

Need help as I'm trying to create performance scenario using JMeter 5.6.2 and Firefox Driver Config on Corporate Machine but I'm getting error message :

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line.

Scenario need to be done :

Configurations :

Detailed Error

Driver info: org.openqa.selenium.firefox.FirefoxDriver Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: false, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {profile: UEsDBBQACAgIAI5QNlcAAAAAAAA...}, proxy: Proxy(system)}]}] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:140) ~[selenium-remote-driver-4.10.0.jar:?] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:96) ~[selenium-remote-driver-4.10.0.jar:?] at org.openqa.selenium.remote.ProtocolHandshake.createSession(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.createBrowser(FirefoxDriverConfig.java:36) ~[jmeter-plugins-webdriver-4.10.0.0.jar:?] at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(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:?] at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:802) [ApacheJMeter_core.jar:5.6.2] at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:1029) [jorphan.jar:5.6.2] at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:1012) [jorphan.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:770) [ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:758) [ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:264) [ApacheJMeter_core.jar:5.6.2] at java.lang.Thread.run(Unknown Source) [?:1.8.0_351] 2023-09-22 10:04:30,452 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'jp@gc - WebDriver Sampler'. 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:65) ~[jmeter-plugins-webdriver-4.10.0.0.jar:?] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) [ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) [ApacheJMeter_core.jar:5.6.2] at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]

Upvotes: 0

Views: 307

Answers (1)

Dmitri T
Dmitri T

Reputation: 168072

The error is about Selenium failing to find Firefox

You should:

  1. Set path to the geckodriver in Firefox Driver Config

    enter image description here

  2. Set full path to your Firefox executable via webdriver.firefox.bin property in JMeter's system.properties file like:

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

Be informed of the following:

  1. Using Selenium for performance testing is not recommended by Selenium developers

    Performance testing using Selenium and WebDriver is generally not advised. Not because it is incapable, but because it is not optimised for the job and you are unlikely to get good results.

  2. Using Selenium for performance testing is not recommended by WebDriver Sampler developers

    Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.

So it might be a better idea to implement your login using JMeter's HTTP Request samplers

Upvotes: 0

Related Questions