Calling the Ranorex API inside the Proc you are testing
Posted: Fri May 11, 2012 2:21 pm
Hi,
We use Ranorex for doing some long running integration style testing where we start our application from within our NUnit test fixture (using Process.Start) and then continue in the test to use the Ranorex API to test things in the process that we have just started. This works fine but can take a while to run as our application has a dependency on databases etc.
What we had hoped to do was be able to test individual windows directly within an NUnit test without needing to start our application as another process.
This doesn't seem to be working, and I am not sure why. Is this something that is supported by the Ranorex API or does it always need to be automating an external process. I can attach a sample solution if needed, but basically our tests are currently of the form:
Can the Ranorex API be used in this way?
We use Ranorex for doing some long running integration style testing where we start our application from within our NUnit test fixture (using Process.Start) and then continue in the test to use the Ranorex API to test things in the process that we have just started. This works fine but can take a while to run as our application has a dependency on databases etc.
What we had hoped to do was be able to test individual windows directly within an NUnit test without needing to start our application as another process.
This doesn't seem to be working, and I am not sure why. Is this something that is supported by the Ranorex API or does it always need to be automating an external process. I can attach a sample solution if needed, but basically our tests are currently of the form:
Code: Select all
[Test, STAThread]
public void Test()
{
var userControl1 = new UserControl1();
userControl1.Loaded += (sender, args) =>
{
Task.Factory.StartNew(() =>
{
foreach (Form unknown in Host.Local.FindChildren<Form>())
{
Trace.WriteLine(unknown.Title);
}
Trace.WriteLine("TITLE OF PID" + Host.Local.GetApplicationForm(Process.GetCurrentProcess()).Title);
});
};
Application app = new Application();
app.Run(userControl1);
}
Can the Ranorex API be used in this way?