HI
I'm testing a web application using watin. I need to pass multiple inputs to the application for doing this each time i need to change inputs in the code. So is it possible in watin to accept inputs from excel file.
HI
I'm testing a web application using watin. I need to pass multiple inputs to the application for doing this each time i need to change inputs in the code. So is it possible in watin to accept inputs from excel file.
WatiN offers no (native) way for this. You should solve this with the test runner you are using:
NUnit, MBUnit, XUnit all offer some kind of RowTest functionality which allows you to read data from excel and use that as input for your WatiN tests.
HTH, Jeroen
Lead dev WatiN
The approach that we use is to use SQL Express for our test data, we then generate a DAL layer using subsonic, and pass a string around as a key, and then get the data from the database as a "test data object".
The one line of code that we write in the DAL in a partial class is similar to
public partial class Project
{
public static Project GetProjectDetails(string ProjectName)
{
return new Select().From<Projects>().Where("ProjectName").IsEqualTo(ProjectName).ExecuteSingle<Project>();
}
}
Our test code then looks something like this:
TestData.Project project = TestData.Project.GetProjectDetails(projectName);
domContainer.TextField( ... project name field ...).Value = Project.ProjectName;
domContainer.TextField( ... project type field ...).Value = Project.ProjectType;
The other way is the nUnit feature Jeroen is refering to the nUnit row test extension.
If you were really motivated you could write a WatiN adapter for FitNesse or RobotFramework.