Comprehensive Selenium integration in Hudson with Selunit

This example tells you how to integrate Hudson with Selunit. Selunit can be used to execute Selenium tests directly from Selenium IDE in Hudson builds and using Hudson reporting capabilities provided for JUnit, where Selunit transforms Selenium reports to. The goal is to point out a comprehensive solution beginning with a convenient way creating and maintaining tests using Sel IDE, running them concerning multiple browsers/environments and finally monitoring and analyzing reports in Hudson.

All resources used in this tutorial are focused on examples for testing a travel community portal (“travel lights” in English).

For more information go to

This Article is Submitted by Michael Blank

Issues with Selenium RC and Selenium IDE typeKeys

The typeKeys doesn’t type the ‘dot’ in the text we are entering:
selenium.typeKeys(“assigned_to”, “”);
Your output will be seleniumcom and not The “dot” is missing. This is happening with both Selenium RC and Selenium IDE.
Here is another issue with typeKeys
selenium.typeKeys(“id=username”, “TypeKeys”);
Your output will be “TpeKes” in the textfield. The “Y” is stripped out.
When use “typeKeys” to type “y”, it will active “file” menu in firefox.
Other characters are all OK.

This issue is now fixed when you use the WebDriverBackedSelenium class because you use WebDriver as a backend instead of Selenium Core. The merge with WebDriver for the Sel-IDE side is in progress. But I’ll see what happens in your case but it’s probably in Selenium Core where the problem occurs and not in Selenium IDE. The file concerned is htmlutils.js (function triggerKeyEvent).

How to solve the link has target ‘_blank’, which is not supported in Selenium

Here is an example¬† <a id=”ctl00_contentSection_ViewSeleniumWiki” target=”_blank” href=””>View Selenium Wiki</a>
If you use selenium IDE to click on the link you will get the error message : Link has target ‘_blank’, which is not supported in Selenium! Randomizing target to be:

Here is the solution

<td>echo</td> ' this is only optional

Submitted by Pavandeep Puddupakkam

How did this solution work for you? Do you have a better alternative? Feel free to share your thoughts in comments section below.

Handling Selenium error – verifyXpathCount

Here is an error that I got when I executed the following verifyXpathCount command
<td>xpath=//span[@id=’ctl00_contentSection_GoogleAFSRight’]/div/div[@class=’SingleVertical’]/a[@class=’Heading’ and @href]</td>

Error Message
Unexpected Exception: message -> The expression cannot be converted
to return the specified type., code -> 52, INVALID_EXPRESSION_ERR
-> 51, TYPE_ERR -> 52, result -> 2153447476, name ->
NS_ERROR_DOM_TYPE_ERR, filename ->
chrome://selenium-ide/content/selenium/scripts/htmlutils.js, lineNumber
-> 1170, columnNumber -> 0, location -> JS frame ::
chrome://selenium-ide/content/selenium/scripts/htmlutils.js ::
anonymous :: line 1170, inner -> null, data -> null

I made the following change and the issue was resolved.
<td>//span[@id=’ctl00_contentSection_GoogleAFSRight’]/div/div[@class=’SingleVertical’]/a[@class=’Heading’and @href]</td>

I removed the xpath=.

Submitted By: Pavandeep Puddupakkam

Selenium – createCookie

createCookie(nameValuePair, optionsString)
  • nameValuePair – name and value of the cookie in a format “name=value”
  • optionsString
    – options for the cookie. Currently supported options include ‘path’,
    ‘max_age’ and ‘domain’. the optionsString’s format is “path=/path/,
    max_age=60,”. The order of options are irrelevant, the
    unit of the value of ‘max_age’ is second. Note that specifying a domain
    that isn’t a subset of the current domain will usually fail.
Create a new cookie whose path and domain are same with those of current page under test,  unless you specified a path for this cookie explicitly.