Firefox 3.6 Beta 1 is now available for download

October 31, 2009

icon_lg_browser_ff

The following posting on the Mozilla developer news (https://developer.mozilla.org/devnews/index.php/2009/10/30/firefox-3-6-beta-1-is-now-available-for-download/) announces 3.6 beta 1 of Firefox:

The Mozilla community is proud to release Firefox 3.6 Beta 1 for download. This beta version of the next version of Firefox is built on the Gecko 1.9.2 web rendering engine, containing many improvements for web developers, Add-on developers, and users. The Mozilla community appreciates your feedback and assistance in testing this preview of the next version of Firefox. Your beta software will update itself periodically, and eventually will be updated to the final release itself.

This first revision of the Beta of Firefox 3.6 / Gecko 1.9.2 introduces several new features:

  • Users can now change their browser’s appearance with a single click, with built in support for Personas.
  • Firefox 3.6 will alert users about out of date plugins to keep them safe.
  • Open, native video can now be displayed full screen, and supports poster frames.
  • Support for the WOFF font format.
  • Improved JavaScript performance, overall browser responsiveness and startup time.
  • Support for new CSS, DOM and HTML5 web technologies.

Web developers and Add-on developers should read more detail about the many new features in Firefox 3.6 for developers on the Mozilla Developer Center. For the full list of changes since the alpha release, see this list (it’s big).

Please use the following links to download Firefox 3.6 Beta, or visit the beta download page:

At this time most Add-ons have not yet been upgraded by their authors to be compatible with Firefox 3.6 Beta. If you wish to help test your Add-ons, please also download and install the Add-on Compatibility Reporter – your favorite Add-on author will appreciate it!

The release can be downloaded from http://www.mozilla.com/en-US/firefox/all-beta.html

Cloud Testing has added support for 3.6 Beta to it’s Functional and Cross Browser testing service, which allows users to upload and run their Selenium IDE scripts, capturing screen-shots, HTML, components and timings. Tests can be initiated via an API or via the web portal.

 

See the Cloud Testing website at http://www.cloudtesting.com/ for more details.

 

Subscribers can access the service at http://portal.cloudtesting.com/


API to run your Selenium scripts on Cloud Testing servers now in beta

October 22, 2009

terminal

Cloud Testing has released a updated version of it’s Portal (http://portal.cloudtesting.com/) which now gives customers access to an API (Application Programming Interface). This will give users the ability to initiate tests on the Cloud Testing agents, as well as view the status of projects, scripts and results of individual tests in and XML format.

Cloud Testing allows users to run scripts captured with Selenium IDE in a selection of browsers, with full screen-shots and diagnostics recorded and stored for analysis. For full details of all the features, see http://www.cloudtesting.com/serviceFeaturesFunctional.php


Three ways to view functional test results

October 21, 2009

There are now three different ways to view the results of your Selenium tests that you run using the Cloud Testing service.

You can choose which view of the results to use by selecting from the links at the top right of the page.

results3

The views are:

Overview View

This allows you to see a quick overview of all the steps in the script.

overviewResults

Clicking on the [+] next to a step expands the view so you can see the screenshot that was captured.

overviewResultsExpanded

You can also click on the icons to view the full size screen-shot, HTML or full components list.

Thumbnails View

This view allows you to see all screen-shots from the script on a single page.

thumbnailResults

Details View

This is the classic view, and allows you to see all details on one page.

detailedResults

You can also click on the icons to view the full size screen-shot, HTML or full components list.

Running Selenium Scripts

The Cloud Testing service allows you to upload and run scripts recorded in Selenium IDE, in a number of browsers, for either Functional or Cross Browser Testing. For full details see the website at www.cloudtesting.com


Using the Selenium Highlight command with Cloud Testing

September 22, 2009

There is a little used but handy Selenium command called Highlight. It as you might have guessed highlights an element on a web page, which when combined with the screen-shot capabilities of Cloud Testing comes into it’s own.

The syntax is:

highlight(locator)
Arguments:

Briefly changes the backgroundColor of the specified element yellow. Useful for debugging.

To use this feature within Cloud Testing, just choose the Highlight command, and enter the element or link name e.g. ‘link=Click Me’ for the first argument.

highlight-results

To enable you to view the highlighted area, you will need to add a Capture Screenshot command as the next step in the script, as the highlighting is reset and removed on any page refreshes or reloads.

The area corresponding to the element is highlighted in yellow as can be seen in the following view:

highlighted

The following shows how you would highlight a text box on the screen.

highlight2-results

and a larger view of the highlighted element:

highlighted2

For more information on the Cloud Testing service and features, please visit the Cloud Testing website at www.cloudtesting.com


HOWTO: Cookie manipulation with Selenium and Cloud Testing

August 24, 2009

As the Cloud Testing service uses Selenium RC, and real browsers such as Firefox, Internet Explorer, Safari, Chrome and Opera, cookie handling while running your test should be taken care of automatically. If however you want to do something special, you can override the default behaviour as follows:

Create Cookie

You can add cookies by using the ‘Create Cookie’ command.

The first argument is the name=value, e.g.

PHPSessionID=1213121

The second argument contain options for the cookie. Currenly ‘path’ and ‘max_age’ are supported.

The format is:

“path=/directory/, max_age=3600″

cookies1

Create Cookie example

For example:

Delete Cookie

Cookies can also be deleted using the ‘Delete Cookie’ command. This take the cookie name as the first argument and the path as the second.

Delete Cookie example.

Delete Cookie example.

Full Example

In the following example, we visit a page, from which we get some cookies set by the server, we then add two cookies of our own, before deleting one of them.

Script with cookie create / delete

Script with cookie create / delete

When we run the test, we get the following results:

Results of a test run

Results of a test run

You are always able to view the cookies on any step that has interaction with the web server. After we have visited the page at step 1, we have the following cookies set:

Original cookies - set by server

Original cookies - set by server

After we set our own cookies at step 3 and 4 (CT and CT2), the next server interaction results in us having the following cookies set:

After manually added cookies

After manually added cookies

Note that the original cookies are still set, any new ones are just added.

In step 7 we delete one of the cookies we added (CT), we are left with the original ones from the server plus CT2:

After deleting the manual cookie CT

After deleting the manual cookie CT

For full details of the services and features available from Cloud testing see www.cloudtesting.com


HOWTO: HTTP Basic Authentication with Selenium and Cloud Testing

August 19, 2009

If you need to run tests against a web server that has HTTP Basic Authentication (HTTP Auth) on, there is a simple way to make it work with Cloud Testing and Selenium.

When you access the server manually you get one of the pop-up dialogs, depending on which browser you are using.

ChromeAuth

HTTP Authentication pop-up in Chrome

HTTP Authentication pop-up in Safari

HTTP Authentication pop-up in Safari

HTTP Authentication pop-up in Opera

HTTP Authentication pop-up in Opera

HTTP Authentication pop-up in Internet Explorer

HTTP Authentication pop-up in Internet Explorer

HTTP Authentication pop-up in Firefox

HTTP Authentication pop-up in Firefox

If you fail to get the username and password correct after a number of retries (usually three), you will get a 401 Unauthorised HTTP result code from the server.

HTTP result code 401 - Unauthorized

HTTP result code 401 - Unauthorized

So how do we get round this in Selenium? As we have mentioned in our articles, Selenium does not start processing until the onLoad() event has fired. Since no content has yet been delivered by the web server to the browser, this hasn’t yet happened, so we’re stuck.

Fortunately, there is a workaround. In RFC 1738, which covers URLs (Uniform Resource Locators), we are able to use a username and password in the URL. The following quote from the RFC explains how a URL is constructed:

; URL schemeparts for ip based protocols:

ip-schemepart  = "//" login [ "/" urlpath ]

login          = [ user [ ":" password ] "@" ] hostport
hostport       = host [ ":" port ]
host           = hostname | hostnumber
hostname       = *[ domainlabel "." ] toplabel
domainlabel    = alphadigit | alphadigit *[ alphadigit | "-" ] alphadigit
toplabel       = alpha | alpha *[ alphadigit | "-" ] alphadigit
alphadigit     = alpha | digit
hostnumber     = digits "." digits "." digits "." digits
port           = digits
user           = *[ uchar | ";" | "?" | "&" | "=" ]
password       = *[ uchar | ";" | "?" | "&" | "=" ]
urlpath        = *xchar    ; depends on protocol see section 3.1

; HTTP

httpurl        = "http://" hostport [ "/" hpath [ "?" search ]]
hpath          = hsegment *[ "/" hsegment ]
hsegment       = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
search         = *[ uchar | ";" | ":" | "@" | "&" | "=" ]

Or as a simplified version, your URL needs to look like:

http://username:password@www.mydomain.com/secretarea/

Note that this won’t work on Internet Explorer, since Microsoft has disabled usernames/passwords in URLs as a security measure. If you want to get round this on an installation you have access to, you can add that functionality back in by modifying your registry, as described in the Microsoft Knowledge Base article http://support.microsoft.com/kb/834489.

How to disable the new default behavior for handling user information in HTTP or HTTPS URLs

// To disable the new default behavior in Windows Explorer and Internet Explorer, create iexplore.exe and explorer.exe DWORD values in one of the following registry keys and set their value data to 0.

  • For all users of the program, set the value in the following registry key:
    HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE
  • For the current user of the program only, set the value in the following registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE

If you use Selenium RC (Remote Control), this is done automatically, as of version 0.9.2. As Cloud Testing is built upon Selenium RC, this is taken care of for you already.

For full details of the services and features available from Cloud testing see www.cloudtesting.com


Ideas for new Selenium and Cloud Testing HowTo’s

August 11, 2009

Cloud Testing Logo

Thanks to everyone for their positive feedback on our HowTo articles so far http://blog.cloudtesting.com/howtos/. We have a number of ideas of future articles we’re going to cover, but would be interested in finding out what you want to read about.

Articles we have in the pipeline will cover:

  • Working with pop-up windows using Selenium and Cloud Testing – advanced
  • Checking dynamic text or content using Selenium and Cloud Testing
  • Data Driven Testing using Selenium and Cloud Testing
  • Checking for XSS (Cross Site Scripting) using Selenium and Cloud Testing
  • Cross Browser Testing – strategies using Selenium and Cloud Testing
  • Detecting differences by comparing screenshot images using Selenium and Cloud Testing
  • Capturing component information and headers using Selenium and Cloud Testing
  • Analysing your page content and speed using Selenium and Cloud Testing

If you have any other suggestions, please leave a reply, or contact us.


Processing Pop-up Alerts and Confirmations with Selenium and Cloud Testing

July 17, 2009

This article covers the basics of how Selenium handles pop-ups, as well as how to test them using the Cloud Testing service. Future articles will cover the advanced details of handling Alerts and Confirmations.

What are Alerts and Confirmations?

The following very basic page will use Javascript to display either an Alert (which only has an OK button), and a Confirmation (which has an OK and Cancel buttons), depending on which button is clicked on the page.

<html>
<head>
<title>Cloud Testing Pop-up example</title>
</head>
<body>

<h1>Cloud Testing Pop-up example</h1>
<form action="">
<input type="submit" value="Display Alert"
    onClick="alert('Cloud Testing Alert')">
<input type="submit" value="Display Confirmation"
    onClick="confirm('Cloud Testing Confirmation?')">
</form>
</html>
 

Example Code 1

When displayed in a browser, the following web page is displayed:

popup1

Alert

Clicking on the ‘Display Alert’ button will result in the following Alert box being displayed:

popup2

A single OK button is displayed, along with a warning triangle icon (with slightly different implementations in various browsers).

Confirmation

Clicking on the ‘Display Confirmation’ button will result in the following Confirmation box being displayed:

popup3Two buttons are displayed – OK and Cancel, along with an information/question icon (with slightly different implementations in various browsers).

Processing with Selenium

The following commands are available within Selenium for processing Alerts:

  • getAlert()
  • assertAlert()
  • assertAlertNotPresent()
  • assertAlertPresent()
  • storeAlert()
  • storeAlertPresent()
  • verifyAlert()
  • verifyAlertNotPresent()
  • verifyAlertPresent()
  • waitForAlert()
  • waitForAlertNotPresent()
  • waitForAlertPresent()

The …AlertPresent() and …AlertNotPresent() functions check for the existence or not of an alert – regardless of it’s content.

The …Alert() functions allow the caller to specify a pattern which should be matched.

The getAlert() method also exists in Selenium RC, and returns the text from the previous Alert displayed.

Similar functions are also available for Confirmations.

IMPORTANT NOTE:

Because of the way that Selenium works, any alerts or confirmations that are displayed before the onLoad() method in the page cannot be caught. An example of this

<html>
<head>
<title>Cloud Testing Alert example</title>
</head>
<body>

Displayed before the alert.

<script>
alert('Cloud Testing Alert');
</script>

<br />Displayed after someone clicks OK on the alert.

</body>
</html>

Example Code 2

When viewed in a browser – Google Chrome in this case, the Javascript that displays the alert is processed while the page is loading, and the page will not be fully displayed until the OK button is clicked and the dialog box dismissed.

popup4

The page can now be fully rendered, with the second line of text now displayed:


popup5

Processing with Cloud Testing

To illustrate some of the features of the Cloud Testing service, I have created and uploaded the following script – click to see the full size version:

When this script is run against the page in Example Code 1 above, we get the following results:

Results for pop-up test - click for full size image

Explanation of the Test:

Step 1:

This opens the sample page – successfully.

Step 2:

Click on the ‘Display Alert’ button – again successfully.

Step 3:

Producing a screenshot at this time will not show the Alert dialog box – it is intercepted by Selenium and never displayed.

Step 4:

The ‘Get Alert‘ function returns the text of the last Alert – in this case ‘Cloud Testing Alert’, as displayed.

Step 5:

The ‘Verify Alert‘ function fails at this point, as there are no outstanding Alerts – the previous call in effect clicked OK.

Step 6:

Here we click the ‘Display Alert’ button again, for the next part of the test.

Step 7:

This time the ‘Verify Alert‘ function succeeds.

Step 8:

Here we click the ‘Display Alert’ button again, for the next part of the test.

Step 9:

The ‘Verify Alert’ function fails, as the expression we have passed (‘Cloud Testing Confirmation’) is not what is present in the alert.

Further Information

For further details of the Cloud Testing service visit the website at www.cloudtesting.com


Capturing screen shots of browsers with Selenium and Cloud Testing – Part 1

June 24, 2009

When functionally testing your website, it is always useful to have a screen shot of what the browser window looked like. There are a number of ways of doing this. In this first of a series of articles we cover producing these with Selenium. Future articles will cover further advanced features of Selenium and using the Cloud Testing Functional service.

Selenium

This article concentrates on the Java interface/driver for Selenium RC, however a number of other drivers are available to use (.NET, Perl, PHP, Python, Ruby).

There are two methods of the Selenium class that can be used to capture screen shots. Both capture a PNG to a file.

captureScreenshot()

void captureScreenshot (String filename);

filename – a string of the filename to store the captured screen shot in. E.g.: “C:\sshot.png”.

This method captures the contents of the OS viewport (i.e. whatever is currently being displayed on the monitor), and works on all browsers.

Example:

Selenium browser;
browser = new DefaultSelenium(seleniumServer,
    4444,
    "*firefox",
    "http://www.google.co.uk");
browser.start();
browser.open("/");
browser.captureScreenshot("C:\screenshot.png");
...

Image created using captureScreenshot()

Image created using captureScreenshot()

captureEntirePageScreenshot()

void captureEntirePageScreenshot (String filename, String kwargs);

filename – a string of the filename to store the captured screen shot in. E.g.: “C:\sshot.png”.
kwargs – a string that modifies the way the screenshot is captured. E.g.: “background=#CCFFDD”.

This saves the entire contents of the current window canvas (i.e. what is in the browser, but not the controls, status bar, scroll bars etc.). This currently only works with Firefox (using a built in feature), and IE if you install the SnapsIE tool (available from http://snapsie.sourceforge.net/)

Example:

Selenium browser;
browser = new DefaultSelenium(seleniumServer,
    4444,
    "*firefox",
    "http://www.google.co.uk");
browser.start();
browser.open("/");
browser.captureEntirePageScreenshot("C:\screenshot.png","");
...

Image created using captureEntirePageScreenshot()

Image created using captureEntirePageScreenshot()

Note that this image does not have any of the browser controls or OS visible.

Long Pages

If the web page extends to more than a screen, then this will all be captured with captureEntirePageScreenshot() as shown below:

A long web page captured with captureEntirePageScreenshot()

A long web page captured with captureEntirePageScreenshot()

Contrast this to the following image which does not display the whole page, just scroll bars:

Long web page captured with captureScreenshot()

Long web page captured with captureScreenshot()

Further Articles…

In future articles, we will be covering advanced features of capturing images using Selenium, and how you can make use of these screen capture functions within the Cloud Testing service at www.cloudtesting.com.

See also


Cloud Testing HowTos

June 19, 2009

The fill list of Cloud Testing How To articles can now be found at: http://blog.cloudtesting.com/howtos/


Follow

Get every new post delivered to your Inbox.