Search code examples
seleniumfitnesseweb-testingfitlibraryweb

Could not find fixture: fitlibrary.spider.SpiderFixture


I try to set up Fitnesse with FitLibraryWeb for Selenium based web tests. The tutorial test at /FitLibraryWeb.SpiderFixture.SpiderTutorial.StartingWithSpider works (I changed the driver from firefox to chrome but that should not matter), but if I create my own test page, it always aborts with said error message [1].

I even copied the exact content of the tutorial test page to assure that the test itself contains no errors. What else do I need to make the test page executable?

  • Page type is "test"
  • URL is /SandBox.MyTest

I read in the FitNesse UserGuide, that there are special pages that always get included at the top, namely PageHeader and SetUp for tests. But neither of these exist:

  • /FitLibraryWeb.SpiderFixture.SpiderTutorial.StartingWithSpider.SetUp
  • /FitLibraryWeb.SpiderFixture.SpiderTutorial.SetUp
  • /FitLibraryWeb.SpiderFixture.SetUp
  • /FitLibraryWeb.SetUp

(same for PageHeader)

[1] The test page starts as follows:

!define spider {''!-SpiderFixture-!''}
!| fitlibrary.spider.SpiderFixture |

| ''start spider with'' | chrome |
| ''shutdown browser automatically'' | false |

| ''get url'' | http://localhost:${FITNESSE_PORT}/FitLibraryWeb.TemplateFixture |

Solution

  • OK, I figured it out... The ClassPath documentation was the missing link:

    For a given SubWiki of test pages, you can specify to FitNesse where it can find all of the fixture classes it needs by supplying a so-called ClassPath definition, which is a full absolute filepath to the directory that contains the package (in Java) or assembly (in C#) in which all the compiled classes can be found. Simply include a ClassPath definition on the main page of your SubWiki.

    (emphasis by me)

    So, the code that I searched for, was in FitLibraryWeb:

    !*< paths and defines
    #!path ../bin
    !path lib/fitlibraryweb-2.0.jar
    !path fitlibrary-2.0.jar
    #!path ../../fitlibrary/bin
    !path lib/*.jar
    !define TEST_RUNNER {fitlibrary.suite.FitLibraryServer}
    !define REGRACE_LINK {false}
    !define REGRACE_TOC {false}
    
    *!
    

    These definitions apply for all sub pages in the SubWiki. I copied it to my SandBox main page, changed the type of this page to Suite and now it works!