Need Help : Parameterizing Test with Excel data as Input

178 views
Skip to first unread message

Madhuri

unread,
May 7, 2010, 5:26:25 AM5/7/10
to selenesse-users
I want to create test script, and it reads data from excel,
is this possible

for e.g

!Open firefox*|
!Enter URL| parametername

excel file having above parametername defined with following value
1) Google
2)Rediffmail
3)Yahoo

can i verify above scenario, where a single test case can use multiple
data?

Chris McMahon

unread,
May 7, 2010, 9:20:30 AM5/7/10
to selenes...@googlegroups.com
The entire reason to use the Fitnesse wiki is so that we don't have to
use Excel. Fitnesse is a far superior way to manage test information
than Excel. If you really need to use Excel, then you should use some
tool(s) other than Selenesse, and join some other mail list.

-Chris

Marisa Seal

unread,
May 7, 2010, 9:45:05 AM5/7/10
to selenesse-users
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.

Madhuri Sanap

unread,
May 10, 2010, 12:40:47 AM5/10/10
to selenes...@googlegroups.com
Thanks Chris :)
--
Regards,
Madhuri S.

Karen Tobo

unread,
Jun 27, 2012, 2:54:03 PM6/27/12
to selenes...@googlegroups.com
I've discovered that the following scenario definition and test script are *not* the correct way to implement Marisa's idea for running multiple iterations of a single test. Can anyone point me toward the proper way of doing this?

!|scenario|Search for Allocation|name|and verify allocation found|
|Click the Search/New link|
|Click the Allocation/Subnet radio button|
|Search for Allocation with Name|@name|
|Verify allocation found with Name|@name|
|Click on the allocation search result|
|Verify allocation details show name |@name|


#!|script|
|Log in to app with username|${USERNAME}|and password|${PASSWORD}|
|Verify that I am logged in as |${USERNAME}|
!|Search for Allocation|allocationName|and verify allocation found|
|allocation name|
|myname1|
|myname2|
|Log out|

Thanks,

 - Karen
Reply all
Reply to author
Forward
0 new messages