i have tried the version:
- ResetRanorexCore: after doing that, a FindForm-Command thows null-reference-exception. Are there constraints ?
- the Parent-Problem still occurs (also rarely)
what can i do else as workaround ?
regards jörg
Ranorex.CommandFailedException / SerializationException
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Ranorex.CommandFailedException / SerializationException
Some additional thoughts:
1.
Please check the ApartmentState of the NUnit thread, it must be STA (Single Threaded Apartement). Usually, NUnit runs the testing thread with an MTA apartment state while Ranorex assumes STA (and requires STA).
An instruction on how to do that can be found here:
http://www.hedgate.net/articles/2007/01 ... unit-test/
The first option is to place a config file in the same directory as you NUnit test library DLL. The second option is to create a new thread with STA in every test method calling Ranorex.
2.
Is it possible to run the most important part of the test without NUnit (from the command line).
I would like to check whether the problem exists only within NUnit or not.
Jenö
Ranorex Team
1.
Please check the ApartmentState of the NUnit thread, it must be STA (Single Threaded Apartement). Usually, NUnit runs the testing thread with an MTA apartment state while Ranorex assumes STA (and requires STA).
An instruction on how to do that can be found here:
http://www.hedgate.net/articles/2007/01 ... unit-test/
The first option is to place a config file in the same directory as you NUnit test library DLL. The second option is to create a new thread with STA in every test method calling Ranorex.
2.
Is it possible to run the most important part of the test without NUnit (from the command line).
I would like to check whether the problem exists only within NUnit or not.
Jenö
Ranorex Team
Re: Ranorex.CommandFailedException / SerializationException
Hello!
I have a solution for you...
I too have faced this problem when using nunit and DLL for execution and not EXE.
RanorexSpy is somehow locked up by nunit and that causes all your trouble.
The solution is more of a workaround then really a solution but at least it works.
One: Create Application Domains and put RAnorex into it.
Second this is more simple:
Create a plus Console Application that has the sole purpuse of executing a function that starts your respective test. And that Console Application will be started from your initial test.
So if you have a test like Calculator do the following.
Test: Press + Button.
[Test]
public void runTest( string someparameter)
{
Something.runTest( "PressPlusButton" );
}
This test is called by your Console Application which calls the respective test.
This way the Console Application will be between nunit and the Test. And after the test finishes it is no longer a problem because the EXE garbage collects the RanorexSpy properly. This way your long term test runs weill me no problem anymore.
Please ask away is something is unclear.
Gergely.
I have a solution for you...
I too have faced this problem when using nunit and DLL for execution and not EXE.
RanorexSpy is somehow locked up by nunit and that causes all your trouble.
The solution is more of a workaround then really a solution but at least it works.
One: Create Application Domains and put RAnorex into it.
Second this is more simple:
Create a plus Console Application that has the sole purpuse of executing a function that starts your respective test. And that Console Application will be started from your initial test.
So if you have a test like Calculator do the following.
Test: Press + Button.
[Test]
public void runTest( string someparameter)
{
Something.runTest( "PressPlusButton" );
}
This test is called by your Console Application which calls the respective test.
This way the Console Application will be between nunit and the Test. And after the test finishes it is no longer a problem because the EXE garbage collects the RanorexSpy properly. This way your long term test runs weill me no problem anymore.
Please ask away is something is unclear.
Gergely.
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
Re: Ranorex.CommandFailedException / SerializationException
Hello Skarlso
Thank you for your help, but the behaviour occurs also in an easy main-application (STAThread) without NUnit, so the proposed solutions shouldn't be successful.
best regards Jörg
Thank you for your help, but the behaviour occurs also in an easy main-application (STAThread) without NUnit, so the proposed solutions shouldn't be successful.
best regards Jörg
Re: Ranorex.CommandFailedException / SerializationException
Did you try it out? 
It happened to me too. This helped. If it does not help you, you can still revert.
It isn't a hard work takes thirty minutes tops.
Np, hope it helps anyways.
Gergely.

It happened to me too. This helped. If it does not help you, you can still revert.

It isn't a hard work takes thirty minutes tops.
Np, hope it helps anyways.
Gergely.