Integration testing becomes easier and more fun with Xebium. Selenium is a great tool for regression testing, and FitNesse is great for maintainable acceptance testing. Combining them gives you the ease of FitNesse and the power of Selenium, in a non-intrusive way: record your Selenium tests with the SeleniumIDE like you're used to, translate them automatically and run them from FitNesse!
You can also clone the project with Git by running:
$ git clone git://github.com/xebia/Xebium
With use of the Xebium Format a script recorded in Selenium IDE is automatically translated into wiki syntax and can be pasted into FitNesse. And reverse: Wiki syntax can be copied back to Selenium IDE and can run as a selenium script. Very useful for debugging
You can execute any custom build fixture code around the execution of the selenium test and use the default Setup and Teardown mechanism. This is great for bringing the system under test into the right state, setting up pre-conditions and cleaning up before running a test.
Because the tests are part of the FitNesse wiki you can create pages and test suites. These can be grouped in a tree structure, just like normal FitNesse tests. With FitNesse scenario table fixtures you can easily reduce duplication by making reusable components. Finally the documentation can be added right with the tests in the wiki. All this makes the tests much more maintainable.
FitNesse's variable substitution makes tests less dependent on hard-coded values.
Use scenario tables to out-of-the-box create new methods enabling data-driven testing.
Xebium empowers you to use FitNesse without any development support, no coding is required to get you started.
The Xebium setup can be roughly divided into two separate parts:
[IMPORTANT]
Please be aware that Xebium has fixed dependencies on specific versions of Selenium and
FitNesse.
The current stable version Xebium 0.10 depends on Selenium 2.29.0 which functions with Firefox
versions upto 18.0.x.
In the meantime development on Xebium continues, which leads to new features and broader browser (version)
support. Be aware; using these newer development versions might introduce unexpected behavior and stability
issues.
Download the latest stable project version by simply pressing Free Download
Alternatively the latest project version can be retrieved from Github allowing you to easily stay up-to-date, in order to do so Git is required
For building the project Maven is required and needs to be setup
Open the command-line terminal and navigate to this directory
$ git clone git://github.com/xebia/Xebium
$ mvn -Pfitnesse test
Maven will retrieve all necessary dependencies into a Maven repository, the first time this might take a couple of minutes
FitNesse (v20121220) Started... [java] port: 8000 [java] root page: fitnesse.wiki.FileSystemPage at ./FitNesseRoot [java] page version expiration set to 0 days.
Leave the terminal window open to keep FitNesse running (control-c will shutdown the server)
With this Step 1 is completed
Make sure Firefox is installed and contains the Selenium IDE plug-in.
Open Firefox and go to the following location: selenium-xebium-formatter
Choose the + Add to Firefox option
When prompted with the Open with option select Firefox and press OK
Restart Firefox
Open Selenium IDE in the Firefox Tools menu
From the Selenium IDE menu choose Options -> Options...
On the General tab check the "enable experimental features"
and "disable format change
warning messages" check-boxes
Go to Options -> Format and select the xebium-formatter from the list.
You are now finished with Step 2
Continue to the Getting Started section to create your first Xebium test case
The Following sections describe how to create a new test page in FitNesse and how to record and add a simple Selenium script.
Be aware that using the record-&-play functionality from Selenium does not always result in very reliable tests, use the recorded scripts as the basis for your test but keep in mind that these scripts often need adjustments in order to make them reliable and robust
In the ExampleSuite of the Xebium project many ways are shown how to improve your tests; FitNesse Scenario Tables allow you to create readable and reusable components from your recorded scripts. With XPath and CSS you can improve object recognition.
Click the Xebium! logo to view the sample project.
The ExampleSuite contains several examples on how to use the Xebium! fixture
In the Add menu, press Test Page to create a new page.
The new page name should get a name written in CamelCase.
In the content section of the page we can add a basic structure describing what our test is supposed to do:
| Given a browser on google.com | | when a query is done for Xebium | | then search results should be found |This is a quite basic example.
In the Firefox menu select Tools>Selenium IDE.
The latter is done by right clicking your mouse on the link and selecting the waitForText link=Xebium Xebium option from the bottom of the menu.
The right mouse button allows you to add additional verifications to the script that is being recorded. In addition to this countless commands and checks can be added manually in the Selenium IDE (Use the Command dropdown to see all possible options).
Run the script from the Selenium IDE in order to verify that it correctly works.
If the test succeeds go to the Source tab.
If all is right the script looks something like this:
| script | selenium driver fixture | | start browser | firefox | on url | http://www.google.com/ | | ensure | do | open | on | / | | ensure | do | type | on | name=q| with | Xebium | | ensure | do | click | on | name=btnG | | ensure | do | waitForElementPresent | on | link=Xebium - Selenium from FitNesse | | stop browser |
Before the script steps we add a scenario table describing the first step:
!| scenario | Given a browser on google.com | | start browser | firefox | on url | http://www.google.com/ | | ensure | do | open | on | / |
!| scenario | when a query is done for Xebium | | ensure | do | type | on | id=lst-ib | with | Xebium | | ensure | do | click | on | name=btnG |
!| scenario | then search results should be found | | ensure | do | waitForText | on | link=Xebium | with | Xebium | | stop browser |
| script | selenium driver fixture | | Given a browser on google.com | | when a query is done for Xebium | | then search results should be found |
!*> Step implementations !| scenario | Given a browser on google.com | | start browser | firefox | on url | http://www.google.com/ | | ensure | do | open | on | / | !| scenario | when a query is done for Xebium | | ensure | do | type | on | name=q | with | Xebium | | ensure | do | click | on | name=btnG | !| scenario | then search results should be found | | ensure | do | waitForElementPresent | on | link=Xebium - Selenium from FitNesse | | stop browser | *! | script | selenium driver fixture | | Given a browser on google.com | | when a query is done for Xebium | | then search results should be found |
There is a Xebium support group on Google Xebium User Forum
You can find out more about Xebium on the Xebia blog site
Find out how to correctly setup your environment to run against IE, Chrome and Safari Setting Up IE, Chrome and Safari drivers
Xebium is a powerful instrument, but please don't take test automation lightly! The following blog by Gojko Adzic might give you some helpful guidelines: UI Testing Explained
Xebium is written by a group of passionate java developers from Xebia in the Xebia App incubator project
A screencast will come soon...
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement of third party rights. In no event shall the copyright holder or holders included in this notice be liable for any claim, or any special indirect or consequential damages, or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software.