Extreme online shopping with WAPT Pro

Ivan Lisitsyn

5 years ago

Recently we have discovered that our load testing solution can be applied in a quite unusual way. One of our users has shared his “success story” with us. It perfectly shows how widely you can apply the product if you know its features very well and have a good fantasy.

The story is actually about Cyber Monday online shopping. You know, some web sites run very special actions to attract customers. They sell limited number of items at exceptionally low prices. In theory you can make a very good deal if you participate. In practice this is almost impossible, because each new item is ordered by someone immediately after it becomes available. Here is where WAPT Pro appeared to be a great automation solution.

The rest of the story is provided as is. (Personally I do not think that such things break any laws, but the original author asked me to keep his name confidential.)

In the late November GaGa Deals (gaga.aliexpress.com) launched a Cyber Monday sale. I was interested in purchasing some electronic devices, because the real discount on some items was about 90%, which seemed to be quite a good deal for me.

Each lot had a countdown to the moment when the “Buy Now” button became available. So, if you wanted to buy that lot, you should have been the first to click it.

After few manual attempts I realized that the required reaction time was less than one second. Moreover, it depended on the synchronization of your local system time with the server. So, it became quite obvious for me that the game was useless and I needed to apply a more serious solution. Fortunately I had it at hand.

WAPT Pro is a load testing tool that we normally use to test the performance of web applications. It can emulate real web site users with virtual ones by executing a predefined sequence of actions. So, you can record a user session with help of a browser and then replay it with multiple users. In this specific case I did not need many concurrent users. My goal was to execute one session very fast, which was also possible in the product.

I recorded a typical session that I was going to emulate. For that purpose I selected a less attractive lot that allowed me to click the “Buy Now” button manually without haste. I verified the test and confirmed that most session-specific data was parameterized automatically by WAPT. I would only need to replace the lot ID to apply the recorded virtual user profile.

I launched the “test” with the next “great deal” item. Well, that first attempt was not successful at all, because I discovered that my virtual user tried to click the “Buy Now” button sooner than necessary. The server discovered that and returned an error. Fortunately, a simple solution was shortly found: I added a loop in the profile and the button click was executing now until it returned a valid result. It was a conditional cycle, so I have to validate the response with a simple JavaScript function. Fortunately, the Pro version of WAPT supported that.

As a result, my virtual user was able to get to the order page. Here I came across another problem that seemed to be severe at first glance. The page contained a captcha. In other words, it was protected against robots, but WAPT was a robot after all…

I knew about few ways to get round the problem. For example, you can grab the captcha link and send it to one of the automatic recognition services. They return the sequence of letters and numbers that they read from the picture. (Don’t ask me how and why those services exist). Since I only needed to read a single image, I could simply view it myself (after taking from WAPT) and enter the data back to a file used by WAPT. However this solution seemed to be a bit slow to me, so I invented a better one, but it is a secret. If you decide to reproduce the whole process, you can use one of the ways mentioned above.

Now I had a virtual user profile for the whole ordering procedure and was ready to try with the next attracting lot. It was Samsung Galaxy S3 for as low as $99.99. I launched the process 30 seconds before the target time and when it did the thing, I started to browse logs with a great excitement. I was disappointed and surprised again. It did not manage to take the lot because it was too slow! According to the WAPT log files, it only spent 600 milliseconds to click the button, but that was too late. My competitors were a bit faster. Who would ever believe that they were humans?..

Ok, I started to research the problem again. I tried pinging the server and got 250 milliseconds response time. It was way too long for this kind of tricks. I run traceroute to the server and discovered that it was hosted somewhere in California.

The solution was quite straightforward. WAPT Pro can use load agents located remotely. This means that the whole communication to the target server is done from a remote location. If it is very close to the server, it will work very fast independently from the connection speed to the workplace component from which you manage the test execution.

Thanks to Amazon, it is very easy these days to get a load agent in California. I created a virtual system instance in the Amazon cloud at the West Coast location. It took just a minute to download WAPT Pro and setup a load agent to the newly launched system image. Now everything was ready. I mean really ready this time.

Fortunately right at the moment a new very tasty lot was about to fire. It was Nikon D7000 camera still for $99.99. I clicked the “Run test” button in WAPT and was waiting with bated breath for the outcome… And it finally happened! This time I had the Nikon D7000 for less than $100 in my cart!

I paid the order and after some 20 days the lot was delivered to me without any problems. It was real Nikon D7000 and I am still happy to make great shots with it. Now preparing for the next year sales…