Go to http://fitnesse.org/FitNesseDevelopment.DownLoad and download the the latest fitnesse.jar. Create a directory c:\program files\fitnesse\. Copy the downloaded fitnesse.jar into directory c:\program files\fitnesse. fitnesse.jar is an executable jar file so just double click this file and it will install itself.
Download Selenium Remote Control (Selenium RC)
Go to http://selenium-rc.openqa.org/download.jsp and download the latest version (1.0.3 at the time of writing this page). Unpack the zip into c:\program files\selenium\ directory. Current version for Selenium-RC is 1.0.3 and these instructions are written assuming you are using this version.
Create a smart start script
Copy and paste following script into a file called run.vbs under the directory “C:\Program Files\selenium\selenium-server-1.0.3”. This script will start both FitNesse servers and Selenium remote control servers on their default ports 8000 and 4444 respectively. This script will ONLY start these processes if these processes are not running, so this script can be safely run any time.
PS: Please note that this script is starting Selenium in an experimental Proxy Injection Mode which lets you run your web test across multiple domains. If you don’t want to use this feature feel free to change this start script.
Download and Install Generic Fixture
Just follow simple instructions at this page or just download genericfixture.jar from here and drop it into “C:\Program Files\fitnesse” directory.
Copy selenium-java-client-driver.jar from “C:\program files\selenium\selenium-remote-control-1.0.3\selenium-java-client-driver-1.0.3” to “C:\program files\fitnesse” directory.
Run startup script
Using Windows explorer go to the directory “C:\Program Files\selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3” and double click on the run.vbs. This will start 2 Java process in 2 separate command windows with Selenium window in normal and FitNesse window in minimized state.
Create a page on FitNesse for Google Web Test using Generic Fixture
- Open your browser and goto the URL http://localhost:8000/FrontPage. Look for the Edit button on the left hand navigation column. If Edit button is not present then goto the URL http://localhost:8000/FrontPage?properties and select the “Edit” check box and click on Save Properties. Now click on Edit button and once on the Edit Page add a new line at the end of all the text already there and save your changes.
- Now on the Front Page it will display a text like “Web Test Suites?” with ? as hyper link. Click on ? link.
- Once in the Edit Page copy paste following text into text area and save your changes:
- You will notice 3 ? links on the page. Now lets create each and every missing page.
- Click on the ? link next to SuiteWebTests.SetUp text and on the “Edit Page” text area copy-paste following code an save your changes.
- Go back to the page: http://localhost:8000/FitNesse.SuiteWebTests
- Click on the ? link next to SuiteWebTests.TearDown text and on the “Edit Page” text area copy-paste following code an save your changes.
- Again go back to the page: http://localhost:8000/FitNesse.SuiteWebTests
- Now click on ? link next to SuiteWebTests.GoogleTest text and on the “Edit Page” text area copy-paste following code an save your changes.
- After saving your changes click on Properties button from the left hand navigation menu and click on check box left to Test property and save your changes. Now you should see Test button on the top of the lest navigation menu.
Execute your Google Web Test Page on FitNesse using Selenium
Just click on the Test click on this page: http://localhost:8000/FitNesse.SuiteWebTests.GoogleTest and watch the magic of web test being run. Test will open a new Firefox browser and go to http://www.google.com and search Google with query text “fitnesse generic fixture”
Upon completion of test you should see this on the top of the results page:
Assertions: 5 right, 0 wrong, 0 ignored, 0 exceptions
Optional but Recommended Installations
You are all set to to write your test tables in FitNesse.
However if you are doing web testing using Selenium, there are two very handy add-ons for Firefox that will be extremely useful for writing web tests:
- XPath Checker: Download it from https://addons.mozilla.org/en-US/firefox/addon/1095
- Selenium IDE: Download it from http://selenium-ide.openqa.org/download.jsp