We are happy to announce that we recently added support for Firefox 7 to our monitoring and load testing products! You can now explicitly specify the Firefox version your script will run against.  Currently we support both Firefox 3.6 and Firefox 7.

For example, the following script will open the Firefox 7 browser and navigate to a url:

var selenium = browserMob.openBrowser("FF7");
browserMob.beginTransaction();
browserMob.beginStep("Home Page");
selenium.open("http://seleniumhq.org/");
browserMob.endStep();
browserMob.endTransaction();

The same is possible when using the Selenium 2.0 API (WebDriver):

Hello Readers!! It gives me immense pleasure in meeting you with yet another article on WebDriver. WebDriver has been creating a lot of buzz among the Selenium community lately and BrowserMob, an active member of the Selenium community, wasted no time in announcing its support for the WebDriver API.

I hope you had the chance to read the great introduction article on the Webdriver API by fellow blogger Ben.

In this article I would like to touch on the basics of scripting with the WebDriver and the BrowserMob API.
I’m sure many of you, who are new to this API are asking yourselves these questions just like I did.

It’s almost that time of year again. Holiday shoppers looking to stay at arm’s length from the seasonal mall madness will undoubtedly turn to the Internet to make their gift purchases. In fact, ShopperTrak predicts national retail sales will rise 3% during November and December this year as compared to the same time period last year.

In order to keep up with this expected spike in website traffic, there are a few steps ecommerce companies should take to ready their site. In order to help, we’ve rounded up the top eight load testing and website monitoring tips to help ecommerce sites stay on their “A-game” this holiday season.

Hello Testers – First, I have to admit that I am not a Flex/Flash developer and cannot take credit for the following content. This was produced by my colleague and fellow BrowserMob blogger, Anu. It is documented internally but I believe the BrowserMob community will find value so I scrubbed it and published it.

Overview

Traditionally, testing Flex/Flash applications was difficult because the logic/behavior is encapsulated from the browser. With the introduction of Flex 3.x,  came the release of the Adobe Automation Framework; and Gorilla Logic developed a lightweight testing application called FlexMonkey. In conjunction, a Selenium plugin was created – FlexMonkium. Now Flex recording and playback are seamlessly interleaved with native Selenium recording and playback so you can easily automate the testing of hybrid web applications that mix HTML and Javascript with Flex.

Hello Readers!! Welcome back to Part 3 of our Load Testing Best Practices series, which focuses on writing good load testing scripts.

As I’m sure you would agree to, load testing is an imperative part of every development effort. One of the key components to your load testing efforts is a good load testing script that simulates real user behavior on your web site in the most realistic and accurate way possible.

Before you take a deep dive into the scripting, there are few things you need to plan ahead of time.

When developing BrowserMob scripts, it helps to quickly validate changes you’ve made to the script.  That is why BrowserMob provides the Local Validator tool for you to install on your machine.  This tool allows you to validate scripts while not having to deal with the delay of validation in the web portal (i.e. Clicking the update button, waiting for the web page to refresh, etc.).  This post is a quick guide to installing the BrowserMob local validator on a Linux machine.

For the purpose of this guide, we’ll be installing to Ubuntu (v10.04).  To use the local validator, you’ll need the following software installed:

Hello Testers – as many readers are probably aware, both Firefox\Firebug and Chrome have a console panel for evaluating JavaScript, testing XPath expressions / CSS selectors (i.e. inspecting the DOM), and analyzing the HTML. To learn more about the Console, check out the following:

Google: http://code.google.com/chrome/devtools/docs/console.html

Firebug: http://getfirebug.com/commandline

The syntax used for inspecting the DOM of XPath and CSS is slightly different.

XPath syntax: $x("")
CSS syntax: $$("")

Given the code block:

<div class="element-block"><a href="http://www.google.com/" class="code-block-link">Google</a> , <a href="http://www.amazon.com/" class="code-block-link">Amazon</a></div>

The HTML output is:

Some associated XPath and CSS selectors are:

As you build out your script and plan for a successful load test, it’s important to design the script that incorporates timeout values. BrowserMob has a few types of timeouts that you can use: HTTP-level, Selenium page-level, and Script-level timeouts.

HTTP-level timeouts are controlled by the HTTP client, usually the “c” variable. var c = browserMob.getActiveHttpClient(); and there are 3 commands relating to HTTP timeouts: setConnectionTimeout, setRequestTimeout, and setSocketOperationTimeout.  For more information, check out our API documentation which outlines each of these commands.

selenium.waitForElementPresent(“myelement”);

The waitForElementPresent commands polls the page waiting for the specified element to load. If you are familiar with Webmetrics/WATIR scripting, the command is very similar to the wait_until() command. The waitForElementPresent command is most often used on sites containing dynamic content such as Ajax, JavaScript, etc. Scripts are designed to execute as quickly as possible and Selenium tends to fire steps faster than the DOM can render changes, causing issues/errors with the script playback.

There are a few ways to determine if you need this command:

The first is to check the playback in SeleniumIDE:

This article covers how BrowserMob can be used to test mobile websites by modifying the User-agent header and connection speed to match the desired device (iPhone, Android, etc.).
When deciding which version of the website to serve up, most mobile-enabled web applications rely on parsing the User-Agent http header. By modifying this value, BrowserMob Real Browser Users (RBUs) can be turned into “Mobile Browser Users”.

The first step is to determine what specific devices you want to simulate. Zytrax has put together a great compilation of the various different mobile browser user-agent strings here.
Once you’ve determined the User-Agent strings you want to test, the next step is to update the script to overwrite the standard User-Agent header in Firefox. This can be done via the following snippet:

© 2012 The BrowserMob Blog Suffusion theme by Sayontan Sinha