How to run data driven test in fitnium using fixture

83 views
Skip to first unread message

Jaya

unread,
May 20, 2011, 5:16:48 AM5/20/11
to Fitnium
Hi,

I am very new to Fitnium. I have a testcase which I need to run it
multiple times, and need to give different set of inputs each time.

From what I read in the user guide, I found that we need to write a
fixture and create a table in Fitnesse UI. Then we need to run the
test. But when I do that I get the error: "Could not invoke
constructor for login[0]" and "The instance decisionTable_1. does not
exist".

Here is the table (In Fitnesse wiki page):

//Imported all jars

!|com.magneticreason.fitnium.BaseFitniumFixture|

| login |
|user name|password|
|!-jg...@xyz.com-!|p@ssword|
|!-JG...@xyz.COM-!|p@ssword|

...followed by the test code to start browser, enter login, password
etc:
|enter|${userName}|in input field|login|

Here is the fixture:

package login;
import fit.ColumnFixture;

public class LoginUserCredentials3 extends ColumnFixture {
private String userName;
private String password;

private void setUserName(String userName) {
this.userName = userName;
}

private void setPassword(String password) {
this.userName = password;
}

public String username() {
return userName;
}

public String password() {
return password;
}
}
}

Please let me know how to run this.

Keith Sterling

unread,
May 20, 2011, 7:48:23 AM5/20/11
to Fitnium
You don't have to write any code for Fitnium and you can't load data
from one fixture and then pass it to the fitnium fixture

I've guessing from the code below that you are trying to run the test
with a number of different userid and passwords

If you are new to Fitnium, first write a fitnium test with the user
and password hard coded into the Fitnium Fixture
Once you have it working you can use a couple of options to turn the
table into data driven

You can use an Excel spreadsheet see the section on Reading And
Writing Data in the User Guide

http://<YouFitniumInstall>/FitniumUserGuide.SlimGuides.ReadingWritingData

Also have a look at the following 2 discussions which might provide
more help

http://groups.google.com/group/fitnium/browse_thread/thread/72661e8323d24d45?hl=en_US

http://groups.google.com/group/fitnium/browse_thread/thread/cb4ba0f2949c9594?hl=en_US
On May 20, 10:16 am, Jaya <jayagup...@gmail.com> wrote:
> Hi,
>
> I am very new to Fitnium. I have a testcase which I need to run it
> multiple times, and need to give different set of inputs each time.
>
> From what I read in the user guide, I found that we need to write a
> fixture and create a table in Fitnesse UI. Then we need to run the
> test. But when I do that I get the error: "Could not invoke
> constructor for login[0]" and "The instance decisionTable_1. does not
> exist".
>
> Here is the table (In Fitnesse wiki page):
>
> //Imported all jars
>
> !|com.magneticreason.fitnium.BaseFitniumFixture|
>
> | login |
> |user name|password|
> |!-jgu...@xyz.com-!|p@ssword|
> |!-JGU...@xyz.COM-!|p@ssword|

Jaya

unread,
May 22, 2011, 6:31:24 AM5/22/11
to Fitnium
Hi Keith,

Thanks for your fast response. I am able to read data from excel and
run my tests using that data, but I am unable to loop my test case
multiple times for different combinations of username and password.

I need to execute the same form filling test case for a different sets
of data combination. I would be thankful to you if you could guide me
on this.

Thanks,
Jaya Gupta.
Reply all
Reply to author
Forward
0 new messages