Hi kumprave5,
Thank you for the reply.
Currently, there is no officially documented API for managing error behavior at runtime. The below snippet should get you going but please know that undocumented API is unsupported and should be used with caution. The below snippet is a very simple example of how you can adjust error behavior at runtime as a work around.
using System.Linq;
public void setEB()
{
var TS = (TestSuite) TestSuite.Current;
IList<TestSuiteEntry> entryList = TS.GetAllTestSuiteEntries();
TestSuiteEntry entry = entryList.Single(s => s.Name == "myTestCase"); //Specify your test container
var node = (TestCaseNode)entry;
//Report Error behavior
Report.Info("Entry Name: "+ entry.Name + " | Error Behavior: " +node.ErrorBehavior.ToString());
//Change Errory Behavior
Report.Info("Changing Error Behavior");
node.ErrorBehavior = Ranorex.Core.Testing.ErrorBehavior.ContinueParent;
//Report Error behavior after change
Report.Info("Entry Name: "+ entry.Name + " | [CHANGED]Error Behavior: " +node.ErrorBehavior.ToString());
}
The above code will report the current error behavior of the test entry "myTestSuite" (which is a Test Case in my example) and will then change it to ContinueParent or whatever you wish to use.
If having officially documented API to change error behavior is an important feature to you, then I would highly recommend making a post on our User Voice platform. This is a platform where users can submit and vote on features to improvements to Ranorex. User Voice is reviewed by our product management team so it is the best way to get your requests to us. Please find our
Ranorex User Voice here.
I hope this helps!
Jon