Home > database >  Getting IllegalArgumentException when running jmeter webdriver script
Getting IllegalArgumentException when running jmeter webdriver script

Time:03-11

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

CodePudding user response:

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.

CodePudding user response:

@Dmitri T, after reviewing some other tickets, I thought of using PhantomJS, but the script is still not working. I am getting the following error. All I was trying is with the same sample code to navigate to google.com and using same javascript

java.net.MalformedURLException: unknown protocol: about
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler.sample(WebDriverSampler.java:90)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Unknown Source)
  • Related