The BrowserMob Blog | All about browsers, performance testing, and load testing

TAG | Selenium 2

We’re always working hard to improve our BrowserMob monitoring and load testing services. Over the last few weeks, we’ve pushed pushed out a bunch of improvements:

New Monitoring and Load Testing Location

Hot off the heels of Amazon’s announcement of a new US West Coast cloud data center, we are happy to report that you can now schedule load tests and monitoring jobs from this new location. Simply select the “San Jose, CA” location when scheduling tests.

Selenium 2.0 Support

In December, Selenium 2.0 alpha 1 was released. This release dramatically improves the realism and reliability of Selenium scripts. We’re proud to say that you can try out Selenium 2.0 support (but keep in mind it’s still in alpha) by simply changing your selenium script from this:

var selenium = browserMob.openBrowser();

To this:

var selenium = browserMob.openBrowser(true);

We will continue to keep BrowserMob up-to-date with all the latest happenings in the Selenium world, as well as donate our time and code back to the Selenium project. We also upgraded all the BrowserMob browsers to have the latest version of Firefox (3.5.7) and Flash.

Schedule Load Test UI Improvements

We’ve also made scheduling a load test a lot easier. We now give you a realtime estimate of what the test will cost you, changing dynamically based on your test configuration. We also display tooltips explaining things like “location”, “ramp”, and “constant”. Finally, we’re really excited to have rolled out a “Run ASAP” option that will kick off the test as quickly as it can, usually within 10 minutes.

201001201005.jpg

New Script Editor

Our users love that they can write their scripts using JavaScript, so we decided to make working on that JavaScript code even easier. By utilizing the Bespin open source project from Mozilla, you now will see a rich text editor with code syntax highlighting. If for some reason you’re having trouble with it, you can always switch back to the plain text editor.

201001201011.jpg

New Load Test Charts

We’ve always been proud of our realtime load test charts, but some users had recently complained that they were too heavy-weight and were slowing down their browser. Of course, this is a perfect example of why performance in the browser is starting to matter just as much as performance on the server.

Responding to this complaint, we rewrote the charts from scratch, moving from YUI Charts (Flash-based) to Flot (Canvas-based). We hope you like them!

201001201019.jpg

New Scripting API Improvements

If you do advanced scripting, especially with virtual users, you’ll definitely want to take a look out the BrowserMob scripting API. We added a whole bunch of useful functions, including:

  • setFollowRedirect(true) now logs all intermediate HTTP requests
  • You can now automatically verify response codes
  • If a 3xx response code is returned when you expected something else, the Location header is logged
  • You can tie in “interceptors” for both HTTP requests and HTTP responses, allowing very advanced scripting techniques

[Post to Twitter] Tweet This Post 

· · · · · ·

BASIC authentication is used to provide minimal, low-security protection from anonymous visitors hitting your website. It is frequently used by companies to ensure that their staging or development environments are not accessibly by the general public prior to pushing the changes to production. Typical authentication dialog prompts look like so:

200912080850.jpg

The challenge here is that this dialog box is the kind of dialog that Selenium cannot automate. You cannot issue “type” or “click” commands on it. In fact, if this box comes up, your script is guaranteed to time out because Selenium will continue to wait for the page to load, not realizing a login is required and unable to populate it.

Traditionally Selenium users have worked around this problem by using a URL pattern in which the username and password was encoded:

http://username:password@example.com

Recently, however, this is not working across all browsers. IE no longer supports it and recent versions of Firefox add a confirmation box that breaks the automation with a slightly different popup. And while we’re working on as solution for Selenium 2.0, there aren’t a lot of options for Selenium today.

200912080944.jpg

But when it comes to BrowserMob, we do have a solution available today, which will be soon back-porting to the Selenium 2 codebase. Simply edit your script to look like the following:

var selenium = browserMob.openBrowser();
var c = browserMob.getActiveHttpClient();
 
c.autoBasicAuthorization("example.com", "username", "password");
 
browserMob.beginTransaction();
browserMob.beginStep("Step 1");
 
selenium.open("http://example.com");
// rest of script...
Important: the first argument to autoBasicAuthorization is not a URL, but rather a domain name. Make sure the argument does not start with “http://” or include any parts of a URL.

This code tells BrowserMob to automatically put in the required Authorization headers for any HTTP request issued to example.com. And soon this capability will be added to Selenium 2 (after we get the first alpha out in time for the holidays).

[Post to Twitter] Tweet This Post 

· ·

Theme Design by devolux.nh2.me

Tweet This Post links powered by Tweet This v1.3.9, a WordPress plugin for Twitter.