Parametrize URL variable WebSocket - jmeter

I testing backend application, which is in NodeJS and Java technology. communication: WebSocket in NodeJs part and HTTP in Java part) in JMeter I must parametrize URL, to switch between development URL, production and prepod
I did it by CSV file. I created folder CSV, in the folder where I have Jmeter 5.0. I prepare 3 CSV file
still, don't run this test. When I wanted start test, in View Result Three don't have any test run.
I set this:
CSV Data Set Config –
${__P(environment,development)}.csv
WebSocket Open Connection
Serwer URL – ws
Server name or IP - ${host}
User Defined Variables
Name: Value
Protocol. ${__P(protocol,)}
Host ${__P(host,}
In CSV file I set this:
protocol, host
http, 10.219.227.66
ws, 10.219.227.66
protocol, host
https, prepod.myprepod.io
ws, prepod.myprepod.io
protocol, host
https, production.myproduction.io
ws, production.myproduction.io
please help me and show what is wrong, and what exactly I must improve this, because I very tired this topic yet
Yes in logs I have this wrong
Caused by: java.lang.IllegalArgumentException: File development.csv must exist and be readable
at org.apache.jmeter.services.FileServer.createBufferedReader(FileServer.java:424) ~[ApacheJMeter_core.jar:5.0 r1840935]
at org.apache.jmeter.services.FileServer.readLine(FileServer.java:340) ~[ApacheJMeter_core.jar:5.0 r1840935]
at org.apache.jmeter.services.FileServer.readLine(FileServer.java:324) ~[ApacheJMeter_core.jar:5.0 r1840935]
at org.apache.jmeter.services.FileServer.reserveFile(FileServer.java:272) ~[ApacheJMeter_core.jar:5.0 r1840935]
... 8 more
2018-10-19 14:29:30,727 INFO o.a.j.t.JMeterThread: Thread finished: Authorize success 1-1
2018-10-19 14:29:30,728 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2018-10-19 14:29:30,728 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, local)

Your approach should work, just
Make sure you have development.csv file in "bin" folder of your JMeter installation
Remove User Defined Variables as it is not required and may cause problems
If you won't see your test producing any results make sure to check out jmeter.log file - it's being generated in the "bin" folder of your JMeter installation each time you launch JMeter.
JMeter log file can also be accessed using Log Viewer - click yellow triangle with exclamation mark at upper right corner of JMeter GUI and jmeter log will be shown at the bottom.
Ideally there should be no red number right hand of the triangle, if you see them - this is the number of issues in your test plan.
In the below image JMeter cannot start the test as it is not able to find development.csv file:
See How to Debug your Apache JMeter Script article for more hints on getting the bottom of your test problem.

Related

I am able to run the script with 2 users but not with the multiple users in jmeter

I am able to run the script with 2 users but not with the multiple users in jmeter.
My observations after recording the script for few requests :
Under Workbench - View results tree - Response as
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:209)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:928)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at org.apache.jmeter.protocol.http.proxy.HttpRequestHdr.parse(HttpRequestHdr.java:118)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:210)
Sampler result response: Response message:`Connection reset
ensure browser is set to accept the JMeter proxy certificate``
And i have added JmeterROOTCA certificate in Browser.
Could anyone please suggest why this is happening
The error you're getting is connected with recording tests, not executing the tests. Normally you don't need to add certificates especially into browser for the tests execution. If you're not able to record the test follow instructions from the "HTTPS recording and certificates" chapter of the HTTP(S) Test Script Recorder user manual entry. Sometimes clearing your browser history helps
Workbench was removed in JMeter 4.0 so it looks like you're using quite and outdated JMeter version and according to JMeter Best Practices you should always be using the latest one

Jmeter report giving errors with distributed mode but errors don`t appear in result tree

I am running my test in distributed mode from the GUI. I have some 20,000 users and two vitual machines have more than 4 VPCUs and 80 Gg memory. I can`t see any stress on any of the machines, neither the slaves or masters, nor the server under test and I could hardly see any error in the GUI. However, in the report, I am having the following errors:
Non HTTP response code: javax.net.ssl.SSLException/Non HTTP response
message: Couldn't kickstart handshaking
Non HTTP response code: javax.net.ssl.SSLException/Non HTTP response
message: readHandshakeRecord
Non HTTP response code: javax.net.ssl.SSLException/Non HTTP response
message: Connection reset
The errors are only 0.05%
Can anyone help me what these errors mean and how can I correct them.
You are not seeing the error in GUI because i.e. View Results Tree listener shows only 500 last results, it is controllable by view.results.tree.max_results JMeter Property and if you add the next line to user.properties file:
view.results.tree.max_results=0
next time you run JMeter you will see each and every request in the View Results Tree listener.
Be informed that GUI mode should be used for tests development and debugging, execution should happen in command-line non-GUI mode
For Couldn't kickstart handshaking and readHandshakeRecord - you can get some troubleshooting information by enabling debug logging for SSL, it can be done by adding the next line to system.properties file:
javax.net.debug=ssl
For Connection reset - see JMeterSocketClosed wiki article
If you have access to your application logs - check them for any suspicious entries
More information:
Apache JMeter Properties Reference
Apache JMeter Properties Customization Guide

Not able to Initialise smartmeter as ite generate an error?

Error Screenshot I have recorded test scrip using smart meter.
But I when I tries to load the script "Rum smartmeter Test"
It gives following. I have no requirement of remote server as i wanted to run basic Testscript from local machine
*> Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused connect*
Just for the background please note that SmartMeter.io is based on Apache JMeter but adds new features such as one-click test reports, advanced scenario recorder, user friendly distributed mode, acceptance criteria and many others.
Looking forward for your suggestion.
Thanks.
Looks like SmartMeter is unable to start a load generator. The most common reason is that the required port 1099 is already occupied by some other program or the load generator can sometimes be blocked by your firewall. I suggest you restart your computer and try again. If it doesn't help, then you need to find out what is occupying that port. See for example How can you find out which process is listening on a port on Windows?
You should be able to get some information from logs/generator.log.
You can also run tests from SmartMeter Editor, the same way you would do in JMeter.

org.apache.jorphan.util.JMeterError: Could not return sample

I am running Jmeter test in distributed mode. I have set up SSH tunneling for slaves since they are not in same region. I have executed 2700 users which ran fine. When we try to run 5200 users, users are going into finished status although steady state is 1 hours. I am using ultimate thread group.
4500 users are running fine and 600 Users are going into finished state out of 5200 usesr.
Seeing below error in Jmeter Server logs:
ERROR o.a.j.t.JMeterThread: Test failed!
org.apache.jorphan.util.JMeterError: Could not return sample
at org.apache.jmeter.samplers.StandardSampleSender.sampleOccurred(StandardSampleSender.java:70) ~[ApacheJMeter_core.jar:3.3 r1808647]
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source) ~[?:1.8.0_151]
Any idea? What is causing this?
It seems from logs that you tunnel is broken:
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1;
See this:
https://superuser.com/questions/37738/how-to-reliably-keep-an-ssh-tunnel-open
The error is about JMeter slave being unable to establish connection to deliver results to the master so the problem is on SSH server side, you can look into its logs to see what went wrong.
The options are in:
SSH stands for "Secure Shell" so all the traffic gets encrypted. It also gets compressed in order to decrease footprint. When it comes to high loads it might be the case SSH server and/or client consumes a lot of resources and i.e. being killed by OOM Killer or whatever. You can try configuring your SSH server to disable compression and use weaker encryption algorithm, for example arcfour
It might be easier to move "master" to the "other region" than passing a lot of test results over SSH
Another option could be using VPN with no encryption, this way all JMeter nodes will be in the same subnet.
And finally you can disable automatic sending of test results from slaves to the master:
set mode=DiskStore property on JMeter Slaves
when your test is finished collect results from slaves and copy them over to master
use Merge Results Tool in order to combine multiple results into single .jtl file. Merge Results Tool can be installed using JMeter Plugins Manager

org.apache.http.NoHttpResponseException: The target server failed to respond in Jmeter

I have recorded a script and trying to replay the script. During the run i'm receiving the following errors.
java.net.SocketException: Connection reset
org.apache.http.NoHttpResponseException: The target server failed to respond
I'm receiving this errors from the payment gateway hits.
It looks like you're experiencing the issue described in Connection Reset since JMeter 2.10 ?, this is due to applied configuration to make JMeter to act like well-behaved browsers.
If you're totally sure that everything is fine with your server, you can try tweaking some JMeter properties in order to workaround these errors
Add the next 2 lines to user.properties file (located in JMeter's "bin" folder)
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
In hc.parameters file (lives in JMeter's "bin" folder as well) add the following line:
http.connection.stalecheck$Boolean=true
You need to restart JMeter to pick these properties up.
Also above instructions apply to HTTPClient4 implementation. It is default for the most recent JMeter versions, but just in case you can explicitly set it for all HTTP Request samplers using HTTP Request Defaults configuration element.
More often than not, this happens when you use the wrong port. Please check if you are using the right URL (name + port).
In addition to what Sasidhar indicated, you may want to ensure the JVM on the server associated with your port # is up and running. I've seen this when the JVM has been stopped without my knowledge. If none of these work, ensure the target server's httpd.conf file is properly configured and the server is actually up and running.

Resources