I have following problem. When I start my test using nunit as my test runner Ranorex sometimes cannot find element. But when I saw that test hanging for a while, I opened my repo and tried to highlight element with ranorex spy, and I succeeded.
Strange thing is that it is the same repo and same element.
I think that maybe something with my test runner configuration isn't right. As of configuration, I configured nunit this way:
1. I added at my app.config this part:
<configuration>
<configSections>
<sectionGroup name="NUnit">
<section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</configSections>
<NUnit>
<TestRunner>
<add key="ApartmentState" value="STA"/>
</TestRunner>
</NUnit>
</configuration>
2. I added at nunit.exe.config, nunit-agent.exe.config, nunit-console.exe.config this part:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
I'm using .NET 4.0
How I should configure nunit so it can find elements every time?