//This is how we can make the step definitions reusable
[When(@”I run the (.*)”)]
public void WhenIRunTheGenericImporter( String importer)
{
if (String.Compare(importer,” GenericImporter”)==0)
{
StartInfo.FileName = @”C:\TrunkbinDebug WinExecutables GenericImporter.exe”;
}
if (String.Compare(importer,” PageUpImporter”)==0)
{
StartInfo.FileName = @”C:\TrunkbinDebug WinExecutablesPageUpImporter. exe”;
//Passing in argument to the command
//Passing in argument to the command
StartInfo.Arguments = @”lk 410″;
}
ProcessStartInfo StartInfo = new ProcessStartInfo();
Process Process = new Process();
StartInfo. RedirectStandardOutput = true;
StartInfo. RedirectStandardError = true;
StartInfo.UseShellExecute = false;
StartInfo.CreateNoWindow = true;
Process.StartInfo = StartInfo;
Process.Start();
}
Leave a Reply