jeudi 22 juin 2017

Validating Automated Concurrency Test for Shopping Cart With Selenium Grid/TestNG

I have a web application that needs to be tested for concurrency issues. The application only has one product, and keeps track of how much stock is left, how many units of product are getting shipped tomorrow (if there is product in stock and a user puts some units in their cart, it will be considered as being shipped tomorrow), as well as how many units are on backlog due to being out of stock. There is also the capability to add more units to the stock left on the site which can be utilized during testing.

For example: Say there is 50 units in stock. User 1 decides to add 25 of these products to their cart. This means that 25 units remain in stock, and 25 of these units will be shipped to User 1 'tomorrow'. Shortly thereafter, User 2 adds 50 units to cart; which means 25 of them will be shipped to User 2 'tomorrow', and 25 will be put on backlog and shipped once there is more stock available. If User 1 decides to remove all of their 25 units from the cart, the system will put those units back in stock, and then add 25 units to User 2's order for shipping (since we can now fulfill the entire 50 unit order).

My Problem: I can hardcode that scenario using Selenium Grid and TestNG in Eclipse, but I would like to automate the process with many different users, as well as verify that the system has the correct number of 'stock left', 'backlog stock', and 'stock getting shipped tomorrow'. The issue with this is verifying the number of stock in each category is correct with concurrent users.

My question: is this possible to automate and verify with Selenium/TestNG? I have not been able to find any examples addressing this problem with Selenium/TestNG, and am open to suggestions for other tools that are able to simulate testing concurrent users.

Aucun commentaire:

Enregistrer un commentaire