Receiving Empty Response for more users in Jmeter - jmeter

I have a scenario recorded in Jmeter.
Login -> Home Page -> Click on the link to open Page A -> Page A opened -> Click on the tab to open Page B -> Page B opened -> Log off
I executed above scenario with 5 users, Ramp up 20 sec, Loop Count Forever, Scheduler Duration 300 seconds.
Less User Thread
All of the samples were Pass. (Screen shot attached)
Result
I executed with 10 users, Ramp up 20 sec, Loop Count Forever, Scheduler Duration 600 seconds.
[10 Users Thread][3]
This was also successful. (Screen shot attached)
Result
I increased users to 40, Ramp up 80 and checked Loop Count Forever(Scheduler not selected)
Failed Thread
Samples started failing after some 25 users. (Screen shot attached)
Result1
Response Data is empty for the requested Target page and response code is 200(Page A). (Screen shot attached)Result1
Response code is 500 for Page B. (Screen shot attached)Result2
I have increased the heapsize, also executed script from command prompt.
What could be the issue?
JavascriptError
After some research I got to know that, i have to use Web drivers. How can i integrate to Web driver samplers to my original scripts.

Related

100 requests per minute for a duration of 20 minutes - Load/performance testing

I am doing load test on my system using Jmeter. the requirement is I need to generate 150 requests per minute for a duration of 20 minutes constantly.
I tried with below approaches
I tried by giving this configuration.
No of threads - 3000 [150 req/min * 20 mins]
rampup period - 1200sec [20mins * 60]
But here test stopped after creation of 2004 thread. by giving
this error
Failed to start the native thread for java.lang.Thread “Thread Group 1-2004”
Uncaught Exception java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached in thread Thread[#51,StandardJMeterEngine,6,main]. See log file for details
Used concurrency thread group with below details
Target concurrency - 150
ramp up time - 1 min
hold target rate time - 20 mins
but here no of samples collected are more than 3000 [150 req *20 sec] which i feel is not correct
Is it possible to create exact load according to my requirement in Jmeter(150 req/min ->duration of 20 mins) or should I explore other tools like locust??
tried with precision timers (attaching screen shots)
enter image description here
enter image description here
enter image description here
Your understanding of relationship between users and hits per second is not correct.
When JMeter thread (virtual user) is started it begins executing Samplers as fast as it can. The throughput (number of requests per second) mainly depends on the response time.
For example:
you have 1 user and 1 second response time - the load will be 1 request per second
you have 1 user and 2 seconds response time - the load will be 0.5 requests per second
you have 2 users and 2 seconds response time - the load will be 1 requests per second
you have 4 users and 2 seconds response time - the load will be 2 requests per second
etc.
If you want to slow down JMeter to the desired number of requests per minute it can be done using Timers.
For example:
Constant Throughput Timer:
Precise Throughput Timer:
Throughput Shaping Timer

Duration Based Apache JMeter Scenario

am running test in duration based scenario with jmeter 5.4.1, at the end of the script, test is getting stop prematurely without executing some of the calls in the last iteration, please help me to make sure all the calls executed in the last iteration, i have tried loop,duration controller nothing seems. to be prominent
Example: i have home, login, search,select item & logout, duration of 5 min with 1 user
Test execution : Home 10 login 10 search 9 select item 9 logout 9
Test execution : Home 10
login 10
search 9
select item 9
logout 9
If you set duration in the Thread Group or in Runtime Controller it doesn't guarantee that all Sampler will be executed equal number of times, when the duration is reached or exceeded JMeter will start shutting down the threads (virtual users) and the total number of sample results will mainly depend on the application response time.
So if you want to execute everything 10 times only - set number of loops in the Thread Group to 10 and either increase or remove the duration.
Alternatively you can use Concurrency Thread Group configured like:
this way 1 user will execute samplers for 5 minutes as fast as it can but not more than 10 times.

Gatling - problem with users creation with rampUsers when other scenarios are working

I have spotted some strange behaviour of gatling.
I have 5 scenarios which have such "setup":
scn[00-04].inject(constantUsersPerSec(simulationConfig.UsersPerSec) during
(simulationConfig.maxDurationSeconds seconds).max(simulationConfig.maxDurationSeconds)).protocols(protocol),
UsersPerSec = ~0.8
maxDurationSeconds = 240
and additionaly one scenario with:
scn05.inject(nothingFor(120 seconds), rampUsers(100) during(2 seconds))
.protocols(protocol)
So whole load last 240 seconds and after 120 seconds additional load should be created during 2 seconds. What I have observed:
after starting creation of additional 100 new "users", old "users" from first 5 scenarios did not execute requests / stay inactive some time (why?)
amount of 100 "users" is not reached after start ( internally only one blocking request to soap service is sent during one action - it can take from 5 seconds to ~30seconds ), it stays on about level of 70 (dark blue line) but it should reach amount of 100 "users" (why?)
OK, I have created another test-project with:
scn00.inject(rampUsers(100) during(2 seconds))
.protocols(protocol),
scn01.inject(nothingFor(20 seconds),rampUsers(100) during(2 seconds))
.protocols(protocol)
In those scenarios I had left only
.feed(customFeeder)
.pause(1 seconds)
.exec(customAction("Action X")((testData) => {
val y = testData.getConfig -- sometimes reads shared file during initialization
Thread.sleep(20000)
}))
and results looked:
why in this chart we can see that:
amount of 100 users was not reached? rampUsers(100) during (2 seconds)
in that point this scenario should ends ( it contains almost only Thread.sleep(20000) )
why: second scenario could reach amount of 100 users even if it differs only with nothingFor(20 seconds), additionaly: why this scenario did not start after 20seconds but 40 seconds?
why: second scenario was frozen for 60 seconds and started to finishing after first scenario was completed by all users?
why it did not looked more or less like this:
I guess you're confusing injection profile for something that would drive virtual users lifespan.
Injection profiles only drive when users are injected/started.
Lifespan is driven by your scenarios, once a user reach the end of its scenario, it terminates.

JMeter Webdriver waittime issue

I have a scenario where I need to click on a button in the Web page which will do a process. Once I click on this button "process in progress" message will appear. I am waiting for this message to disappear from the web page for the next action.
This process will take time between 30 to 150 secs which I don't have control.So I have given a wait time of 180 secs in the sampler. The issue is some time the process will complete in 30 secs and webdriver will wait for 180 secs to complete for the next action. In this case application will log out because inactive user settings.
How to handle this situation?
You can use ExpectedConditions.presenceOfElementLocated combined with WebDriverWait.
It would wait at max 150s but if element is available before it doesn't wait that much:
var wait = new pkg.WebDriverWait(WDS.browser, 150);
wait.until(pkg.ExpectedConditions.presenceOfElementLocated(
pkg.By.cssSelector('ul.suggestions')))
See full details here:
https://jmeter-plugins.org/wiki/WebDriverSampler/
You can go for ExpectedConditions.invisibilityOfElementLocated(By) function which can be used via Explicit Wait so WebDriver will poll the DOM until the element disappears with the maximum of 150 seconds, default polling interval is 500 milliseconds, however it can be adjusted as required.
Example code would be something like:
var wait = new WebDriverWait(WDS.browser, 150)
wait.pollingEvery(1, java.util.concurrent.TimeUnit.SECONDS)
org.openqa.selenium.support.ui.ExpectedConditions.invisibilityOfElementLocated(By.xpath("//*[contains(text('process in progress')]"))
More information: The WebDriver Sampler: Your Top 10 Questions Answered

java.net.SocketException:connection reset in JMeter [duplicate]

I have the next test plan in JMeter:
on the screenshot you can see the settings for the 1st ThreadGroup, wich has 50% of common amout of request in test plan (in each Thread Group are 10 different subrequests placed).
So, +1 request per second is added in average using these settings.
Then I ran this test and saw this picture (Error % column):
I save errors in file and all these errors have the same text:
<sample t="30129" lt="0" ts="1356710138314" s="false" lb="WebService(SOAP) Request 1" rc="000" rm="**Connection reset**" tn="jp#gc - Stepping Thread Group1 3-247" dt="text" by="0"/>
Server's cpu screenshot:
and for database:
After the errors have appeared my comp started work slowly and slowly (although the errors stopped to appear further)...
And in the same time the server's cpu progressively dropped to 0.
Could you tell me, please,
What is the reason of this error?
Have I reached the server timeout? (Because Max is more than 30s in the table).
UPD. I have rerun test with next settings: 1000 users per 02:46:40 (+1 Thread Group per 10 second and 10 requests inside each new Thread in the Loop).
I.e. I have reduced the time of test and total Thread Groups by 2 times, but save intensivity of Thead's adding.
The results are the same (including cpu usage on the server).
I've received the error «Connection reset» after 990 thread started. There are screenshots:
Any idea?
First, WebService(SOAP) Request is not the best way to test Webservices in JMeter, it will be deprecated in upcoming 2.9 version.
HTTP Sampler is the one to choose as it performs much better.
Second, Connection Reset means your server has cut connection. It could be coming from the CPU which seems high but it's not sure.
If what you call "my comp" is the computer hosting JMeter started working slowly then your JMeter instance is overwhelmed by the number of threads (2003 or more?) you've configured. It can come from a lot of factors, read this:
http://www.dzone.com/links/see_how_to_make_jmeter_run_thousands_of_threads_w.html

Resources