0

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 :

  • Automate Microsoft login page using selenium with the help of jp@gc - Firefox Driver Config and jp@gc - WebDriver Sampler

Configurations :

  • JMeter Version : 5.6.2
  • Selenium-api Version : 4.10
  • Geko-Driver Version : V0.33.0 - X64
  • Plugins Manager is installed
  • "jp@gc - Firefox Driver Config" and "jp@gc - WebDriver Sampler" installed
  • Firefox Browser installed version : 117.0.1 (64-bit)
  • Firefox Installation Path : C:\Users\username\AppData\Local\Mozilla Firefox
    • Note: I'm note able to change the browser.exe location to default or change in the system variables as it's a corporate machine and I don't have admin role
  • ** JMeter System Property file was edited to add the Divers path by using the following command : webdriver.gecko.driver=C:/Users/username/Downloads/DriversLatest/geckodriver.exe

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]

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, but still facing the same issue after adding the browser full path in the system.properties file and adding the driver path in the Jmeter field , any advice !screenshot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.