I have posted the repository and the recording c# files.
Here is my calling code and how i have implemented it. I hope I am catching all the other exceptions.
Is there something that I am missing?
Code: Select all
string logFileName = Application.StartupPath + @"\Test.rxlog";
try
{
Keyboard.AbortKey = Keys.Pause;
//Setup the log file
Report.Setup(ReportLevel.Info, logFileName, true);
//This function should be overidden by any inherting class.
RanorexStart();
Report.End();
base.Result = "Pass";
}
//The following catch statements will catch and handle different
//exceptions thrown by either Ranorex or the application while
//executing the Ranorex class/function
catch (ImageNotFoundException e)
{
Report.Error(e.ToString());
Report.LogData(ReportLevel.Error, "Image not found", e.Feature);
Report.LogData(ReportLevel.Error, "Searched image", e.Image);
Report.End();
HandleError();
}
catch (RanorexException e)
{
Report.Error(e.InnerException.Message.ToString());
Report.End();
HandleError();
}
catch (ThreadAbortException)
{
Report.Warn("AbortKey has been pressed");
Thread.ResetAbort();
Report.End();
HandleError();
}
catch (Exception e)
{
Report.Error("Unexpected exception occured: " + e.ToString());
Report.End();
HandleError();
}
Code: Select all
[Serializable]
public class PRTestingWithLinearStagePart3wFail : RanorexTest
{
public override void RanorexStart()
{
base.Name = "PRTestingWithLinearStagePart3 w/ Fail"; //Sets name for TE TestSequence
AutomateXYprStagePart3_w_fail.Start();
}
}
When I run the test in Ranorex Studio its ok. When call the function in my app via the Start, it causes a crash.
The crash happens when the validation does not pass and continue on fail is set to false.
Thanks for the help in advance