0

In Jmeter after adding chrome driver support there is a proxy tab where we can give proxy. I am selecting SOCKS Proxy and giving the IP address as we are using tunneling and then connecting to a website.

While executing the test, I am getting the below error

2020-10-01 10:52:30,746 ERROR o.a.j.t.JMeterThread: Error calling threadStarted
org.openqa.selenium.InvalidArgumentException: invalid argument: entry 0 of 'firstMatch' is invalid
from invalid argument: cannot parse capability: proxy
from invalid argument: Specifying 'socksProxy' requires an integer for **'socksVersion'**
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
...
...
2020-10-01 10:52:30,754 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.

I am not sure how to give socks version. I tried giving "SOCKS5\127.0.0.1" but no luck.

If someone who has experience in Jmeter with Socks5 proxy please help

1

I don't think current WebDriver Sampler implementation supports setting SOCKS proxy as it should be done via ChromeOptions and it's implemented via Capabilities

You can reach out to plugin developers/maintainers via jmeter-plugins support forum and ask to fix the issue (or you're welcome to contribute the fix yourself)

If this is something you cannot afford at the moment you can consider switching to JSR223 Sampler where you will have full control of how the browser is configured/started so you will be able to do something like:

System.setProperty('webdriver.chrome.driver', '/path/to/chromedriver')

def options = new org.openqa.selenium.chrome.ChromeOptions()
options.addArguments('--proxy-server=socks5://127.0.0.1:8080')

def chromedriver = new org.openqa.selenium.chrome.ChromeDriver(options)
chromedriver.get('http://example.com')

More information: Apache Groovy - Why and How You Should Use It

| improve this answer | |
  • Sure I will try that – gzix Oct 30 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.