Our Professional Services team has been extremely busy over the past several months helping Customers prepare for what proved to be a very busy online shopping season. I’d like to share with you a couple of unique challenges that we came across and how we were able to use the BrowserMob platform and some special customizations in order to successfully test what normally would be impossible using just Selenium or a traditional http-based testing approach.

File Uploads

We worked with a large online greeting card company to completely automate the creation of a card, complete with multiple file uploads. Typically, we see file uploads implemented using a standard web form which are easy to automate with Selenium and the BrowserMob filePath directive. However, in this case, the upload used a Flash component to control the upload which then presented a native OS dialog to the user to select the file as in the screenshot below.

Unfortunately, these types of dialogs are not accessible by Selenium and thus require native mouse and keyboard integration as mentioned in this this earlier blog post. As the interaction was relatively simple (just select the file to be uploaded), we were able to automate this using BrowserMob’s special native keyboard and mouse utilities.

As a result, we were able to completely automate the creation of a card from start to finish and the Customer was subsequently able to integrate this script into their regular testing process. Please keep in mind that this type of interaction is quite brittle as it relies on specific x,y coordinates to be clicked on and can cause the script to break over time as objects are re-positioned on the site. In this case, as the interaction was relatively simple, it worked out well. For more complex interactions using Flex, we strongly recommend checking out Gorilla Logic’s solutions as mentioned in this article.

Streaming Media

Another Customer came to us with a requirement to simulate a streaming media event for hundreds of users they were hosting using a Windows Media infrastructure. We were able to customize the boot-up process of our standard load testing agents and install the Mplayer plugin for Firefox which allowed us to stream the content across hundreds of browser and multiple locations. The Customer was then able to diagnose performance issues and bottlenecks in advance of the actual live event, saving them a lot of time and effort in the process.

During this engagement, we also used a special statistical sampling technique to verify that the content was playing as expected. In the script, we purposely threw an error, approximately 5% of the time which then took a screenshot and video of the transaction which we were able to review in real-time along with the Customer’s team. The relevant script snippet to accomplish this is included below:

function randomid(minVal,maxVal)
{
  var randVal = minVal+(Math.random()*(1+maxVal-minVal));
  return Math.floor(randVal);
}

if (!browserMob.isValidation()) {
    	var id = randomid(1,1000000000);
    	//randomly take a screenshot 5% of the time
    	var shot = randomid(1,20);
    	if (shot == 5) {
		throw("Catch body broken: IOException " + "user id " + userid + "-" + id + " " + new Date().toString());
        }

What type of special testing requirements do you have that are complex and challenging? Contact us and let us know, as we can help you come up with a solution!

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

 

© 2012 The BrowserMob Blog Suffusion theme by Sayontan Sinha