Jmter performance of website parallel users - performance

I have a scenario like to checks the performance of a website. The script should cover the scenario described below.
4 parallel users will open the web page (each user will start 5 seconds after the previous user) and each user will execute the following flow 3 times:
Search for a product on the main page
look-up the product within the search results
if found, open the product's page (if not found start over with another search)
add the product to the cart
check the confirmation message that the product has been added successfully to the cart
Each time the user executes the flow, it should search for a different product (it is ok if different users search for the same products).
I have recorded script in jmeter, but in http request showing as
pls provide suggestions

4 parallel users will open the web page (each user will start 5 seconds after the previous user) - Thread Group configured like
if found, open the product's page - put the HTTP Request samplers which are responsible for opening the product page and adding it to cart under the If Controller
check the confirmation message that the product has been added successfully to the cart - take a look at Response Assertion
Each time the user executes the flow, it should search for a different product - take a look at CSV Data Set Config

Related

Automated tests with Laravel

I am new to PHP laravel framework.
My application is very basic:
User first log-in with login and password (html form)
The user can add items in a mysql table. This are numeric values. There are 2 controllers: One to see all rows and another to add/edit row
Another Controller computes statistics (sum, average, etc.) on the numeric values stored in the table.
What i want do to is to test this application.
I want to write a test that:
Creates an empty database
Creates a user
Log-in this user on my application
Creates entries in my table throw my application (not directly in mysql)
Check in the listing page if each entry has been created properly
And i want to check if the statistics are good (check good values displayed on the webpage.
I have read about Testing section on Laravel's website documentation.
Here are my questions:
I do not se how i can automated database initialization
I do not see how i can check if a span or div contains a specific value (i only can test http response code and if webpage contains a given string).
I have worked with phpunit.
Thanks a lot

woocommerce cart session duplicating

I have a client who is experiencing issues with their Wordpress/WooCommerce website.
Issue: The website is automatically adding products to the cart (Roughly 40-60). The issue occurs for both logged-in & logged-out users. The issue can occur when trying to login to the My Account section, when adding items to the cart or sometimes after adding items to the cart and then visiting the cart it will override cart items with new random items.
I have noticed that in WC_Session_handler the value for _customer_id is often not unique nor is the other session data.. I have removed all server & front-end caching, searched for any other sessions initialized.
Any help would be appreciated as they are losing business due to customers not being able to remove the items from their cart (As the removed items re-appear quickly)..
Domain Name: thecoffeehopper.com :)
The cart is constructed from data in the wp_woocommerce_sessions and wp_usermeta MySQL tables.
I would run the following sql queries to try and find the source of your problem.
select * from wp_woocommerce_sessions;
select * from wp_usermeta where meta_key like '_woocommerce_persistent_cart_%';
The data from these rows are used to construct the cart. Are the random items found in any of these rows? The rows have a user id or customer id to tell which customer the data belongs to.
The data in these rows are serialized strings and is difficult to read directly so I would use the WordPress CLI tool and apply the function maybe_unserialize() to the SQL results.

How handle bot to count pageviews

I don't know how exactly handle this situation. I have a directory where I count the pageviews for each item. For authenticated users I only count as new pageview after a delay of 200 seconds between requests. For unauthenticated users I use the IP and also 200 seconds of delay.
I use a redis SETEX to verify and then the key will expire after 200 seconds. If the key doesn't exist, then insert a new page view.
Something like this
item_id:user_id (authenticated users)
item_id:ip (unauthenticated users)
Well, this works fine until a user try to increment intentionally the page views for a specific item. I have almost 3000 views for a specific item only yesterday (in last year the page has only 150 views...). So, he created some bot to visit the page with a delay to avoid my validation.
I need to register legit pageviews, but I need to avoid the type of fraud. Any idea?
As far as I know, the best way for handling bots is a way like Google Analytics.
Google Analytics works by inserting a JavaScript snippet into the
header of your website. This snippet counts a page view whenever a
visitor triggers that JavaScript, and most bots do not process
JavaScript.
You can integrate some kind of CAPTCHA in your application to limit the number of times a user can view the page within a specific amount of time.
Upon a set number of views within a given duration (say, 20 views in under 3 minutes) from the same user or IP, make them verify the CAPTCHA each subsequent time they try to view the page.
Issue a Token for every page view request. Store the token in the Cookie.
User your already available IP or USER_ID as a filtering mechanism.
After page loaded, User the token, old_token from the cookie, Operating System, Browser Name and IP / User_ID to validate the request.
Give two different timings, like 200 second expiration time and 3600 seconds of grace time, if any of the above data matches within the grace time, don't count the page view.
You can also extend this by keeping track of page views within grace time and create some methods to validate pageview request.
I usually register the Request Time together with the Request to measure the Visit Frequency and the Visiter Count per certain Time Span.
When you register all the Request that come in with with the item_id, user_id, ip and timestamp you can afterwards process the Registers by grouping them by user_id, ip and timestamp.
That way you can find out the amount of Hits per Second and identify and exclude those who clear surpass the normal Activity Pattern without loosing Data.
Often I use the Web Service Logs to generate Statistics about Visit Frequency to certain URLs on a hourly, daily or even monthly basis.

In Google Analytics, why are Unique Pageviews higher than Sessions if it can only fire once per session?

I think I get the different between Users, Sessions, and Pageviews in Google Analytics.
A Visitor/ User can start several sessions even in the same day, of a website ... and each session is comprised of visiting many pages, possibly more than once.
Here's the confusion ... what the frack is the difference between Unique PageViews and Sessions, when applied against a certain page?
A Unique Pageview is basically --- was the page viewed at least ONCE during the session? If yes, +1, else, +0. Isn't that IDENTICAL to sessions?
At least, for an individual page.
I know you can visit 4 unique pages during a session, but a specific page should have the two things equal, right?
The report seems to be presenting the correct data.
Here is how I understand it : - For a given page, the Unique PageView counts the number of sessions that displayed this page one or more times. Unique Pageviews is the number of sessions during which the specified page was viewed at least once. A unique pageview is counted for each page URL + page Title combination.
But it is not how it shows in the case you have presented
Vs
In actual it shows Sessions and Unique Pageviews different.
Our explanation is that the unique pageviews are being shown in funnel which is same as Sessions but when applying filters based on session, you are being shown the session with Entrances on that page for some reason.
To confirm this – you can test adding a segment as shown below and match the output numbers.
1. When you check segment on a page, the session count is 5562 (as the report) I.e. all sessions in which that page was viewed.
When you check segment on a landing page, the session count is 600 (close to the filter report 589) I.e. all sessions in which that page was the landing page.
Ideally we also expect to see the number to be 5562, in the filtered view under the ‘sessions’ metric when we filter on a single page. Also, we expect the sessions to be same as unique pageviews but somehow the metric shown is referring to the ‘sessions that started with that page’ i.e. entrances.
Here is your actual answer, I think! :)
http://help.analyticsedge.com/googleanalytics/misunderstood-metrics-sessions-for-pages/
Basically, if you filter sessions results down to a page, you will see a count of how many sessions started on that page. (Sessions only get attached to the Entrance page).
Cheers.
The Unique Pageviews metric is an approximation of how many times the page has been viewed by a unique user in a given time period. By default, Google Analytics tracking cookie will remember a user on a device for 30 days, unless the user deletes cookies or uses a different device.
Sessions, on the other hand map to Entrances are is a metric that approximates how many times a given page-based dimension was the first hit of a session. A session is defined as an active period of browsing activity by a user of your site. After the session is initiated (someone comes to your site), the session timer will continue to run until either a)the user leaves your site, or b)there is a period of inactivity that lasts for 30 minutes. In either of those cases, the session will be closed. A new session would start when the user resumes activity after that 30 minute period of inactivity, or when they come back to your site.
This behaviour is expected behaviour.
The sessions count is the number of sessions who landed on that screen/page.
The unique page views are the number of sessions who viewed that page.
Eg.
Home screen: 100(sessions) 1000(unique page views)
Interpretation: 100 sessions landed on the home screen and 1000 sessions viewed the home screen( remaining 900 landed on some other screen but eventually viewed the home screen.
This is my understanding:
User A visits Page P1:
Page
Page views
Unique page views
User
Session
P1
1
1
1
1
Same session, user A visits page P2 from page 1 (P1):
Page
Page views
Unique page views
User
Session
P2
1
1
1
0
Notice the session count for page P2 does not increase (0) but unique page views for page P2 is 1.
I believe, because of cases like the above unique page views are greater than sessions count.
You can use this simulator for further understanding.

Creating an order processing system from magento?

I want to create a small order processing website, but in time I want the application to be able to extend to an e-commerce solution as well. So I decided to go with magento.
But I am not sure, if magento can be stripped down to only an order processing system. By order processing I want:
Guests should be able select products
Should be able to add products to cart
But at last, instead of processing the order by payment system, the order should be forwarded to email of administrators, who will contact them individually.
How to configure Magento this way??
Here is a full tutorial with all the files you will need, ready to download:
http://www.excellencemagentoblog.com/magento-onestep-checkout-remove-payment-method-step
This does mark orders with the code 'free', however, you words are our servants and not our masters and you could change the word free to 'telesale' (or whatever):
...the basic idea of removing any step from checkout is to see a set a
default value for that step, so that magento order processing runs
smoothly. So when removing the payment method step, i have set the
payment method “Zero Subtotal Checkout” with code “free” as the
default payment method.
If I got you well, you just want to avoid the CC processing,
In this case you can disable in Magento all payment systems except the 'Money/Check' one.
Guests should be able select products
Should be able to add products to cart
But at last, instead of processing the order by payment system, the order should be forwarded to email of administrators, who will
contact them individually.
Magento offers you catalog/cart system by default ( mail is mandatory during order )
Magento offers you cart system by default
You can disable all payment system except 'Money/Check' one. (this will let user confirm their order without any check on the payment).
Then you can contact all user checking the new orders in the backend ( user/guest email will be displayed along with the order display ) ...
Settings
Add email notification for any new orders:
Log in into admin area
Go to System->Configuration
In Sales section, click on Sales Emails
Select the first section Orders.
Enter your admin e-mail in the field “Send Order Email Copy To”.
Now You will receive a new mail every new order.
Manage Payment Methods:
Log in into admin area
Go to System->Configuration
In Sales section, click on Payment Methods
Disable all except Check / Money Orders
Now your customer could order without any payment detail.
I think Magento should suit you, in case the 'Money/Check' payment system is not good for you, you will need to create a new module and add a new payment system.
I hope this helps you answer your doubt
So, as I can understand, you want to finish customers work on the cart step. For example, by clicking Create an Order except Checkout.
Yes, you can use cart2quote or something like this.
The main idea is to save quote with quote items (from the session) after clicking Create an Order button. For example, you can get Quote and serialize it, get Quote items and also serealize them. When it is needed to show them to admin (in email or in admin section) - deserialize all info and display it. This will not be very easy, but is possible. May be it is better to customize some ready solution.

Resources