Some people have asked us if it is possible to have a user repeat a number of actions after they have logged in or created an account.

Below is a sample RBU script that does just that. The same idea can apply for VU scripts too.

Please keep in mind that the loop should be “contained” and ideally set to a minimum loop count during validation – otherwise you’ll be waiting a long time for the script to validate!

var selenium = browserMob.openBrowser();
 
// Change this to whatever makes sense for the load test
var loops = 10;
if (browserMob.isValidation()) {
    loops = 2; // no need to loop so many times if we're validating!
}
 
// now login here - things done here will not be part of the reported transactions...
selenium.open("http://example.com/login");
selenium.type("username", "patrick");
selenium.type("password", "password");
selenium.clickAndWait("login");
 
// now start the loop which will run the "real" transaction multiple times against the same browser session.
 
for (var i = 0; i < loops; i++) {
    browserMob.beginTransaction();
 
    browserMob.beginStep("Home page");
    selenium.open("<a href="http://example.com/home" target="_blank">http://example.com/home</a>");
    browserMob.endStep();
 
    // more steps and browser actions here...
    browserMob.endTransaction();
}

Given that the government is trying to move online we have started seeing some services get affected by website problems. The unemployment website for Oklahoma City was reported as being down for a second time this month. Apparently there was a server glitch. As we move more services online the government is going to have to become more tech savvy.

But if Cisco is going to have issues with it’s web servers then we can hardly be surprised when small government agencies run into trouble. In the end the best we can do is to hope to minimize downtime due to predictable traffic and monitor sites so that when issues do arise they can be addressed quickly.

There are trade offs between using Virtual Users (VUs) and Real Browser Users (RBUs). The table below shows the advantages of RBUs in many situations, but also points out when a VU might be more appropriate.

Feature VU RBU Advantage of RBU
Scripting Effort Requires JavaScript coding and some knowledge of the underlying application Using Selenium IDE a non-programmer can easily record a script If you can use a browser you can record an RBU script
Download Threads Single thread downloads objects serially 6 concurrent threads download objects in parallel More realistic load characteristics

Today dynaTrace announced that it has intergrated support of Selenium and BrowserMob to allow customers to tie their web load testing to server performance.

In my recent blog post – Get more out of functional web testing: How to correlate test reports with server side log information? – I discussed the problem that testing results are usually not linked to the log and diagnostics information captured by the application under test. The blog entry offered a way to link the two sides using HTTP Tagging via an HTTP Proxy. Tagging individual Web Requests allows linking each individual request executed by the testing tool with the transactions that are executed on the server side. Your logging framework or diagnostics solution can then take this tag and link the transaction to the originating web request. (via dyanTrace Blog)

Recently we had a user ask us if it was possible to get Selenium to follow random links on a page.
Selenium can indeed click random links, but it requires some JavaScript tricks on the browser itself:

var browserJavaScript = “var temp = eval_xpath(‘//a\’, window.document);\n” +            “temp[Math.floor(Math.random() * temp.length)].innerHTML”;

var linkText = selenium.getEval(browserJavaScript);

selenium.click(“link=” + linkText);

What this does is create a JavaScript string that will run on the
browser itself. The JavaScript is written to retrieve all <a> links on the
page and then randomly select the innerHTML (text) for one of the
links on the page.

Yesterday it was Cash for Clunkers, today it is the USPO that is being crushed under the weight of usage.

Over the past hour, multiple attempts to access the site utilizing two different internet browsers have all resulted in the same “waiting for www.prc.gov…” message at the bottom of the screen.

(via The Examiner)

It appears the site was down for multiple hours so many people turned to Google Docs where somone posted a copy of the list. It seems that government infrastructure isn’t quite ready for prime time.

When President Obama took office he promised greater transparency in government. The technology behind this promise was supposed to be the web, but this demands that the government become competent at hosting high traffic web sites.

Car dealers have been trying to register for since early this morning with no success. Many have been unsuccessful given the sheer volume of traffic being directed to the NHTSA website.  Slow response times and error pages are all most dealers have received so far.   The registration pile-up seemed to ease a bit later in the day as some dealer registration Tweets were sent in to us. (via CashForClunkersFacts.com)

© 2012 The BrowserMob Blog Suffusion theme by Sayontan Sinha