tags:

views:

277

answers:

6

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.

A: 

Thanks for the suggestion but, I've already automated my application using the WatiN tool and i'm quiet fluent in using the tool, so to start with a new tool may take some more time.. so i request plz let me know if i can accept inputs from excel sheet using watiN

+2  A: 

This tool might help you: WAX

Wax allows users to create automated WatiN tests using Microsoft Excel

msuvajac
A: 

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

Jeroen van Menen
A: 

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.

Bruce McLeod
A: 

If you were really motivated you could write a WatiN adapter for FitNesse or RobotFramework.

Mark Levison
A: 

WatiN tests are written in .Net. .Net provides functionality to access Excel spreadsheets as needed. Just write them into the test code.