Hello,
One way to accomplish this is with scenarios.
Scenario table definition:
!|scenario|Load the|siteUrl|site and verify|expectedText|is present|
|open|@siteUrl|
|isTextPresent|@expectedText|
Scenario table invocation (in Slim decision table style) in a test
!|Load the|siteUrl|site and verify|expectedText|is present|
|site url|expected text|
|
http://www.google.com| Maps |
|
http://www.yahoo.com| ymail |
Any actions defined in the "Load the siteUrl site" scenario will be
repeated for each row in the decision table. However, if there are
more than a couple actions within the scenario that take a parameter,
you'll have a really long scenario name.
As far as actually reading in data from Excel - this could be done in
fixture code of course...hmm now I'm pondering this. I think the only
way to get each iteration rendered on the FitNesse page would be to
write a Slim Query fixture...which then means that the Selenium/
Selenesse method calls themselves would live in that Query fixture,
and not on the FitNesse wiki page. But then the problem with this
approach is that there would be a disconnect between the FitNesse test
page and the Excel file...so if you had:
|Query:runSiteSmokeTestUsingExcelFile|someExcelFile.xls|
|site url| test result|
| | Pass|
| | Pass|
...and the number of rows in your Excel file changes from 2 to 3, the
test would fail because there's a new unexpected row in the Query
results.
I may think about this a bit more since I'm sure it is something that
comes up often...it's more of a general FitNesse question than
something specific to Selenesse though.