Performance testing a web app using Jmeter - testing

I'm new to jmeter, i tried performance test a web app using it,
It has 4 pages,
Login page(Http Authorization Manager)
Page 1
Page 2
Page 3
Here, when i use my app in real time it take too much time(> 2 sec) to load from one page to another.
But, in jmeter the results shows that the pages loads in quick time(avg time - 668 ms).
Is it hitting the pages individually?(i.e, from login page to page 1 and login page to page 2, etc)
What i wanted to know is, for the below scenario how my app performs with more samples.
Sequence : Login - goto page 1 - click on a link - goto page 2 - click on a link- goto page 3
Or Is there any way to record a sequence and do a load test with 100 users or so?

Here, when i use my app in real time it take too much time(> 2 sec) to load from one page to another. But, in jmeter the results shows that the pages loads in quick time(avg time - 668 ms).
There are some reasons why JMeter is faster:
Jmeter opens only html page, browser opens page with pictures and with another stuff
Jmeter doesn't render html and JS, but browser does
Make some changes to your JMeter script:
Add HTTP Cookie Manager
Add HTTP Cache Manager
Add HTTP Request Defaults
Move Login page as child into Once Only Controller (as you won't login each time, right?)

Related

Reload or not reload google adsense page?

i have a main page where i have a service, the user can enter a text and the text is processed to have to user a response.
I can do it by two ways, reloading the page with http post method in a form or with ajax(laravel livewire) to no reload the page.
The question is, i have google adsense in this page, is better to reload the page in every user request when the user send the form to serve more ads or is better proccess with ajax the form and not reload the ads.
With ajax:
The user enter in page and send the form, only i print 1 time the ad, if the user send 5 times the form, only i showed 1 ad.
With http form request:
The user enter in page and if the user send the form, the page is reloaded because the user send by POST method the form, if the user send the request 5 times, the ad is showed 5 times.
I don't know if the CPC will go down because many impressions are made in the event that the page is reloaded when the user submits the form.
¿What do you think that is better to get the best earnings?
Reloading a page on Google AdSense can cause the ad units on that page to refresh, potentially resulting in new ads being displayed. However, reloading a page too frequently can negatively impact the user experience and may result in lower ad revenue.
It is generally not recommended to reload pages on Google AdSense too frequently, as it can lead to lower ad revenue and increased bounce rates. If you want to refresh the ads, you can use the async feature of Adsense which will refresh the ads without reloading the entire page.
Additionally, Google AdSense has a policy against automatically refreshing pages in order to increase ad impressions. This is considered to be a violation of their policies and can result in your account being terminated.
It is better to avoid reloading Adsense pages unless it's really necessary, and if you really have to do it, make sure you are doing it in a way that is not against Adsense policies.

Scrapy Splash - Not Rendering the full content

I'm trying to scrape this site https://tucson.craigslist.org/search/acc?postedToday=1#search=1~list~0~0, When i try it in splash web console and try to give a wait time of 30 seconds, sometimes it renders the full page and sometimes it is not rendering, When i run in scrapy it did not even render the javascript path, it just returns the rendered content (content received on first call to page)
Can someone help me on this?
Note
This site uses localstorage to store the result and render from there
I deployed the splash instances using the aquarium (Three instances, 1 Slot per instance, 3600 Timeout, Disabled Private Mode)

How to use Scrapy-Splash

I try to use Scrapy to crawl a web whose URL will not change with the page go on.I used Splash to simulate CLICK .However ,it only take me to second page.I wonder how can I keep get next page and how to crawl web like that.

capturing a browser refreshed event using Selenium Web Driver

I am writing a program to automate link validations in a site. Our site is having more than 400 links per page and we need to open each link and see it is returning a valid page i.e 200, there are other requirements as well to check if the page is a 404 redirection page etc. It means to validate 400 inks it will take about 30 minutes or so.
My design is to integrate this with the Front-End (Selenium) automation in a way that each time the browser loads a new page or browser refreshes it will trigger a new thread by passing the page source for validating all the href available.
We are not following a page object model otherwise I could trigger this in my each page.
Question here is that is there any way we can listen to a browser refresh or page load event using Selenium Web Driver?
Correct me if I don't understand your question, but page_refresh and page_load_event can be two very different goals for you, if you are dealing with AJAX. You can try this article about the AJAX part
and this one for selenium custom events synchronization.
This solution here is the most actual I could find.
Actually Selenium is JS driver so this answers can be helpful if you want to try it too:
check-if-page-reloaded-or-refresh-in-js
is-page-reloaded-or-refreshed-using-jquery-or-javascript
post_detect_refresh_with_javascript

Submit button clicked multiple times (jmeter)

I have a web application where there is a login page, an application submission page and a logout page. Once the submit button in the page is clicked, the button gets disabled. I created a script in jmeter for this. I' am using a ultimate thread group with 10 threads. I have a default login credentials as parameters in the login page sampler. When i run this script, first login page sample is executed 10 times, then application submission sample is executed 10 times. Here i have a doubt, how can i handle this application submission sample as in the first thread itself the submit button will be disabled. But, i get a pass scenario when this scenario is ran 10 times.
JMeter is not like QTP/Selenium - It does not check if the button is enabled / disabled.
It sends the http request for the user action. So you will be able to send requests again and again (unless there is a server side logic to handle this - ie user can send only one request or something like that).
But in the source code/http response , you can check if the button is disabled or not by using Regular Expression Extractor. You can build your test accordingly.