fire fox config for web sampler (jmeter) is not working - performance

Please help. My web driver sampler for jmeter is not working. Im using firefox config.
2019-07-12 20:55:38,913 ERROR o.a.j.t.JMeterThread: Error calling threadStarted
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:843) ~[guava-28.0.jar:?]
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:125) ~[selenium-remote-driver-3.14.0.jar:?]
at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:43) ~[selenium-firefox-driver-3.14.0.jar:?]
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:168) ~[selenium-firefox-driver-3.14.0.jar:?]
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:346) ~[selenium-remote-driver-3.14.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:99) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:22) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220) ~[jmeter-plugins-webdriver-3.0.jar:?]
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:762) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:730) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:718) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249) [ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Thread.java:835) [?:?]

The path to the driver executable must be set by the webdriver.gecko.driver system property;
You need to:
Download geckodriver
Define webdriver.gecko.driver Java system property. In case of JMeter it can be done in 2 ways:
pass the location of the geckodriver binary via -D command-line argument:
jmeter -Dwebdriver.gecko.driver=/path/to/geckodriver.binary
or if you want to make the change permanent - add the next line to system.properties file (lives in "bin" folder of your JMeter installation)
webdriver.gecko.driver=/path/to/geckodriver.binary
JMeter restart will be required to pick the property up
References:
Overriding Properties Via The Command Line
Apache JMeter Properties Customization Guide

Related

Not able to record power bi embedding web application in JMeter .app.powerbi.com is throwing error

I am using Apache JMeter 5.3. I am facing issue when my application points connects to https://app.powerbi.com using proxy. I tried using behind the proxy, it didnt help.
Please help me with the error message
Error Message:
java.net.UnknownHostException: app.powerbi.com
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:401)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:930)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:641)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1281)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:234)
Looking at java.net.Inet6AddressImpl.lookupAllHostAddr you're trying to get the IP address for app.powerbi.com using IPv6 implementation
And according to https://en.wikipedia.org/wiki/IPv6 the website doesn't support IPv6
You might want to restrict Java TCP/IP stack to IPv4 only by adding the next line to system.properties file:
java.net.preferIPv4Stack=true
JMeter restart will be required to pick up the property.
Alternatively you can consider using an alternative approach to recording: JMeter Chrome Extension, using it you won't have to worry about proxies, certificates, protocol versions, etc.

JMeter - OutOfMemoryError when retrieving million records in JDBC request

When I'm trying to get above million records in JDBC request, I get an OutOfMemoryError:
ERROR o.a.j.JMeter: Uncaught exception:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source) ~[?:1.8.0_191]
at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source) ~[?:1.8.0_191]
at java.lang.AbstractStringBuilder.append(Unknown Source) ~[?:1.8.0_191]
at java.lang.StringBuilder.append(Unknown Source) ~[?:1.8.0_191]
at java.lang.StringBuilder.append(Unknown Source) ~[?:1.8.0_191]
at org.apache.jmeter.protocol.jdbc.AbstractJDBCTestElement.getStringFromResultSet(AbstractJDBCTestElement.java:563) ~[ApacheJMeter_jdbc.jar:5.1.1 r1855137]
at org.apache.jmeter.protocol.jdbc.AbstractJDBCTestElement.execute(AbstractJDBCTestElement.java:175) ~[ApacheJMeter_jdbc.jar:5.1.1 r1855137]
at org.apache.jmeter.protocol.jdbc.sampler.JDBCSampler.sample(JDBCSampler.java:84) ~[ApacheJMeter_jdbc.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_191]
Is there such a limitation in JDBC? Is it JMeter bug which should stop execution with relevant error?
For example, for smaller records it returns
Response too large to be displayed. Size: 26848889 > Max: 10485760, Start of message:
Out of Memory is not a JMeter bug ... it means your JMeter process runs out of memory.
If using Windows, have a look at following section in your jmeter.bat
if not defined HEAP (
rem See the unix startup file for the rationale of the following parameters,
rem including some tuning recommendations
set HEAP=-Xms1g -Xmx1g -XX:MaxMetaspaceSize=256m
)
You might want to have a search around Stackoverflow as well for issues with JMeter heap space - an example:
JMeter OutOfMemoryError
Be aware that the "Results Tree View" is not designed to display millions of records but for script (aka test plan) development. I for my part would parameterize the number of records and use a small number for development and just use the larger numbers for actual testing (non-gui mode etc).
Open bin/jmeter.sh on linux or bin/jmeter.bat on windows, find this line and remove it from the comment line:
JVM_ARGS="-Xms512m -Xmx512m"
This variable is passed as arguments to jmeter at startup. Increase the default heapsize like this:
JVM_ARGS="-Xms1024m -Xmx1024m"
You could add more space if you needs more.

Websocket Sampler error - java.util.LinkedList$ListItr.checkForComodification(Unknown Source)

I am using Websocket Sampler plugin in JMeter but getting below error during test execution.
- Unexpected error: null
java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
java.util.LinkedList$ListItr.next(Unknown Source)
JMeter.plugins.functional.samplers.websocket.ServiceSocket.getResponseMessage(ServiceSocket.java:149)
JMeter.plugins.functional.samplers.websocket.WebSocketSampler.sample(WebSocketSampler.java:159)
org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622)
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546)
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486)
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
java.lang.Thread.run(Unknown Source)
It’s a bug in this plugin.
Report it to maintainer or switch to alternative:
https://bitbucket.org/pjtr/jmeter-websocket-samplers/src

Jmeter- Webdriver can not load web page on Chrome

I wrote a jmeter - webdriver after a simple sample from the web. Load test should load Chrome and open a specific page. Chrome opens, but page is not displayed,jmeter returns error.
These are specifications:
os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_144'
Chrome version: 65 and higher versions
Jmeter: 5.1.1, selenium-chrome-driver-3.14.0.jar,selenium-java-3.14.0.jar
Thread Group
jp#gc - Chrome Driver Config
path to Chrome driver : C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
jp#gc - WebDriver Sampler
WDS.sampleResult.sampleStart()
WDS.browser.get('http://www.jmeter-plugins.org')
WDS.sampleResult.sampleEnd()
I expect to view page in the Chrome, only Chrome is opened and specific page is not loaded .
Thank you for you time to helping solving my issue.
Jmeter logs error:
Driver info: driver.version: unknown
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:193) ~[selenium-remote-driver-3.14.0.jar:?]
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:179) ~[selenium-remote-driver-3.14.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.getThreadService(ChromeDriverConfig.java:93) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:73) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:21) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233) ~[jmeter-plugins-webdriver-3.0.jar:?]
at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220) ~[jmeter-plugins-webdriver-3.0.jar:?]
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:762) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) [jorphan.jar:5.1.1 r1855137]
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:977) [jorphan.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:730) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:718) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249) [ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_144]
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:20883/status] to be available after 20002 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100) ~[selenium-remote-driver-3.14.0.jar:?]
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:188) ~[selenium-remote-driver-3.14.0.jar:?]
... 13 more
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_144]
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156) ~[guava-25.0-jre.jar:?]
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75) ~[selenium-remote-driver-3.14.0.jar:?]
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:188) ~[selenium-remote-driver-3.14.0.jar:?]
... 13 more
2019-05-08 11:20:03,732 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.0.jar:?]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) [ApacheJMeter_core.jar:5.1.1 r1855137]
Please download the chrome driver from the below link as per your browser version and if not available then update chrome browser:-
http://chromedriver.chromium.org/downloads
Once you have the "chromedriver.exe" then change the path in Chrome driver config
jp#gc - Chrome Driver Config
ex:- path to Chrome driver : D:\ChromeDriver\chromedriver.exe
Hope this solves the issue.

Running jmeter .jmx tests locally using windows command line giving illegal argument exception

Using below command to run the tests on windows cmd - Is there any initialization required in jmeter for doing so.
jmeter -n -t C:/Users/meiyer/Desktop/LOAD TOOLS/jmeter samples/50users10count.jmx
stacktrace -
2016/08/29 15:17:18 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US
2016/08/29 15:17:18 INFO - jmeter.JMeter: Loading user properties from:
C:\Users\meiyer\Documents\apache-jmeter-3.0\apache-jmeter-
3.0\bin\user.properties
2016/08/29 15:17:18 INFO - jmeter.JMeter: Loading system properties from:
C:\Users\meiyer\Documents\apache-jmeter-3.0\apache-jmeter-
3.0\bin\system.properties
2016/08/29 15:17:18 FATAL - jmeter.JMeter: An error occurred:
java.lang.IllegalArgumentException: Unknown arg: TOOLS/jmeter
at org.apache.jmeter.JMeter.initializeProperties(JMeter.java:746)
at org.apache.jmeter.JMeter.start(JMeter.java:385)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:259)
Your issue comes from the space between LOAD and TOOLS.
Use quote around the path:
jmeter -n -t "C:/Users/meiyer/Desktop/LOAD TOOLS/jmeter samples/50users10count.jmx"

Resources