-1

I recently started using the jmeter with selenium webdriver with a sample test and when I run the script the chrome browser is launched but not navigated to the site. I have installed the chromedriver and specified the path in the Chrome Driver Config. Please find the ss below.

enter image description here

enter image description here

In the jmeter.log file this is the error I see

2022-03-09 15:51:35,665 ERROR o.a.j.t.JMeterThread: Error calling threadStarted org.openqa.selenium.InvalidArgumentException: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z' os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_321' Driver info: driver.version: ChromeDriver

2022-03-09 15:51:35,666 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:62) ~[jmeter-plugins-webdriver-3.3.jar:?] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) ~[ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) ~[ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.3] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.3] at java.lang.Thread.run(Unknown Source) [?:1.8.0_321]

Not sure why its not identifying the chrome driver. I even tried to close all the open browsers and still having the same issue. In the first error it says do not use the user-data-dir. How do I configure that in jmeter. One more thing that I am user client laptop with limited access. So I can't create or use new user profile in my chrome. The chrome is managed by my organization. Thanks

Vin
  • 165
  • 2
  • 12
  • See similar question https://stackoverflow.com/questions/59987080/invalidargumentexception-message-invalid-argument-user-data-directory-is-alre – Ori Marko Mar 10 '22 at 06:21
  • @user7294900, I have already looked in to that and the solution mentioned in that question is to create new user profile from the chrome settings. And as i already mentioned that my chrome settings are managed by my organization and I can't create new profile. Is there anyway to do from the code or add commands in the properties files? – Vin Mar 10 '22 at 13:38

1 Answers1

0

The error means that Chrome's User Data Directory is not accessible and ChromeDriver cannot create a new profile there or something like this.

Unfortunately there is no way to specify the user data directory using Chrome Driver Config, you might want to switch to JSR223 Sampler and instantiate the ChromeDriver using Groovy code.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Does that means I should not use the Chromedriver and use Groovy code to launch the browser? but can I still use Webdriver sampler? Can you please provide me sample script to launch the browser in groovy script. That would be great. Thanks – Vin Mar 10 '22 at 13:45