The Lookout

Using the Rad Editor with Fitnesse

Posted on 2009-Dec-7 at 09:25

Since moving over to the WebDriver code for Fitnesse as a fixture, including the SpiderFixture extension, I have had better luck in getting some additional tasks to work.  One item I had been trying to do in Selenium, and never could get it to work, was in making entries into the RadEditor we use on the SharePoint server the product runs on.  With WebDriver there is an option to Execute JavaScript, I don't think it does well with multiple lines but I hadn't tried very hard to get things working in that way; what I ended up with was a single line of JavaScript that finds the iframe, adds the text then moves back to the base frame.  The frame moving took me a few minutes to realize, once you move to a particular frame on the page going back to the base frame is a good follow-up.

 

For those who can use it, the JavaScript to get the RadEditor to work is:

execute javaScript $find(${RadEditoriFrame}).set_html(${test_text});

 

My RadEditoriFrame was set up as: ctl00_PlaceHolderMain_zoneMain_ctl00_txtPost

 

Best way to verify that this is the one to use, especially on SharePoint, is to use an Object Viewer on the page and verify the editor box is highlighted.

 

Hope that helps you out, it took me awhile to get this working.

Setting up Pylot

Posted on 2009-Oct-21 at 09:22

I was in need of a Load Test Tool, now that I have Fitnesse up and running in my environment, I wanted to be able to check and see how our environment was going to behave under a significant amount of Users.  Significant at this point is more than 5, so in looking around I came back to Pylot, not that I needed another language installed on my machine but I liked the simplicity and the ease by which within a day I was up and running with tests that were already confirming to me that the pages I knew were slow, are indeed slow.

 

Check the Getting Started Guide  on how to get it up and running.  But there is one thing missing, if you want to run the Script Agent you will need the Python Win 32 Extensions in addition to the normal set up.

 

When running the Script Agent and running back the XML script I did get a couple of errors about:

    ERROR: can not parse testcase file: not well-formed (invalid token): line #, column #

It took a bit to work through this but basically what happened, in my case, was that the recording took in a NULL value somewhere in the CDATA line on the login and logout of my site, removing those allowed my script to run without a problem.

 

Once you get used to the XML format its easy to parameterize the testcases, and adding in new test steps for text validation and new pages, while the URL's are not the best mechanism in my site to use they do allow me to do a check against bookmarks on the site rather than clicking on the page elements.

 

I'm liking this tool a lot.

Fitnesse and Fitnium Fun

Posted on 2009-Oct-16 at 08:23

Some things I have learned when using Fitnium and Fitnesse.

 

SuiteSetUp and SuiteTearDown are not for actions, those need to go into regular tables, the SetUp and TearDown are not for Action Fixtures.

 

fit.exception.FitParseException: Can't find tag: table - typically means malformed HTML in a page but MOSTLY means you don't have a SetUp or TearDown in your Suite, and within those pages you need something, ANYTHING, even if its simple text.

Another possibility is if the wiki page containing the test has both the Suite and Test properties showing in the left property bar, both properties can also generate the error as its trying to run a Test but has nothing to do.

 

The jar file usually needs to be on any page its called on, don't trust the inheritance with the Parent pages or the Root page, you can try it but if you start getting function errors on the page - well now you know what needs to be added.


When adding URL's make sure they are not in camel case, especially URL's that have been parameterized otherwise the URL may not be sent to Selenium the way you think...and oh yes, PARAMETIZE everything.

Fitnesse Parameterization

Posted on 2009-Oct-14 at 03:17

In order to adjust for the multiple environments that the Fitnesse tests will be running in, within my environment later on, I have spent the time to parameterize the framework now and just added in some Symbolic Links.  The Symbolic Links is a wonderful feature for Fitnesse, as it allows a wiki page to be called from another, so I can set up one page with a test, or a set of tests, and have it called from another.  The true power in this comes from being able to set up multiple high level pages with specific environment information, so one set of tests can be run on Server A if its called from the Server A Test Page which has a Symbolic Link to Server Tests, I can also call the same tests from the Server B Test Page, which has different test settings, and reuse Server Tests within it.  Simple, yet powerful.

 

It did take a little bit of playing around to get the set up working, so here is what I found out.

  • Create the page that will contain the Symbolic Link
  • Go to Properties and set the Suite property on the page and save it, as this page is calling another Suite is needed so the Page will go down the Hierarchy
  • Find the path that will be in the Symbolic Link
  • Go to Properties and set the Name for the Link then the path to the Page, click on Create/Replace
  • Save the settings and edit the page with whatever is needed, the Symbolic Link if used once is automatically called

I don't know what will happen with the need for multiple calls, I have seen examples where instead of looping a page was set up as follows:

    [Username1]

    [Password1]

    [Symbolic Link]

    [Username2]

    [Password2]

    [Symbolic Link]

This should allow testing each Username and Password on that Linked Test Page, I have not tried this yet, have not had a need to, but it should be workable as I believe Fitnesse will take the settings it comes to last.

 

There is probably more to get out of Fitnesse that I haven't discovered yet, I can't wait to see what I find next.


Last Page | Page 2 of 17 | Next Page