Hello Pat,
Thanks for taking the time to look into my problem. I agree theres lots of good information on here and i'm getting little bits from here and there, but im at a stage now where I think I just need the gentle nudge in the right direction.
So here's the situtation... We are using a system called OpenVMS. What i'm attempting to do is to create an automation test suite in C#, its going well so far but everyone still has to manually run batch jobs in openVMS to complete the financial transactions. I dont like having manual steps in my tests! :)
So far i've been able to send commands and read responses no problem, the only issue is when theres a prompt. The issue isnt detecting the prompt I can do that easily its then dealing with the prompt... let me show you my code..
ive not yet worked out how to do this yet because it wont build if i try. I thought maybe I could just cancel the command when it hits the prompt and create a new one, and execute that, but that doesnt work either.
I'm sorry if im not explaining this very clearly, as I said I know how to detect the prompts thats not an issue I just need some way of dealing with them.
In OpenVMS we have DCL's (Digital Command Language) I can use this to run whats known as an ARL (Advanced Reporting Language) and I can do this by creating a text file, filling it with the parameters and then basically saying okay VMS run this ARL and use this text file as your input....Im wondering if I can do that with this? Send a command with a list of parameters to use when it detects prompts....
Thanks for taking the time to look into my problem. I agree theres lots of good information on here and i'm getting little bits from here and there, but im at a stage now where I think I just need the gentle nudge in the right direction.
So here's the situtation... We are using a system called OpenVMS. What i'm attempting to do is to create an automation test suite in C#, its going well so far but everyone still has to manually run batch jobs in openVMS to complete the financial transactions. I dont like having manual steps in my tests! :)
So far i've been able to send commands and read responses no problem, the only issue is when theres a prompt. The issue isnt detecting the prompt I can do that easily its then dealing with the prompt... let me show you my code..
string myCommand = command;
myCommand = myCommand.TrimEnd();
TimeSpan commandTime;
Stopwatch stopwatch = new Stopwatch();
string result = "";
string output = "";
var cmd = client.CreateCommand(myCommand);
try
{
stopwatch.Start();
var asynch = cmd.BeginExecute();
var resultStream = new StreamReader(cmd.OutputStream);
while (!asynch.IsCompleted)
{
commandTime = stopwatch.Elapsed;
if (commandTime > timeOut)
{
break;
}
result = resultStream.ReadToEnd();
output = output + result;
Debug.WriteLine(result);
}
cmd.CancelAsync();
cmd.EndExecute(asynch);
resultArray = output.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
WebDriver.myLogger.LogComment("Class: " + MethodBase.GetCurrentMethod().DeclaringType.FullName);
WebDriver.myLogger.LogComment("Method: " + MethodBase.GetCurrentMethod().Name);
WebDriver.myLogger.LogPass("Executed VMS command: " + myCommand);
}
catch (Exception ex)
{
WebDriver.myLogger.LogComment("Class: " + MethodBase.GetCurrentMethod().DeclaringType.FullName);
WebDriver.myLogger.LogComment("Method: " + MethodBase.GetCurrentMethod().Name);
WebDriver.myLogger.LogFail("Error executing VMS command: " + myCommand + " | " + ex.Message);
}
WebDriver.TestLog().LogStep(WebDriver.TestLog().GetTestResult(), "Execute command");
What I need to be able to do is when i detect the prompt... somewhow change my command "cmd" to something like "Text\R" which would input text and a return...ive not yet worked out how to do this yet because it wont build if i try. I thought maybe I could just cancel the command when it hits the prompt and create a new one, and execute that, but that doesnt work either.
I'm sorry if im not explaining this very clearly, as I said I know how to detect the prompts thats not an issue I just need some way of dealing with them.
In OpenVMS we have DCL's (Digital Command Language) I can use this to run whats known as an ARL (Advanced Reporting Language) and I can do this by creating a text file, filling it with the parameters and then basically saying okay VMS run this ARL and use this text file as your input....Im wondering if I can do that with this? Send a command with a list of parameters to use when it detects prompts....