Page 1 of 1

Thread Aborted Exception

Posted: Thu Jan 30, 2014 11:26 am
by axelvs
Hello,
we sporadically run into a thread abort exception during our ranorex tests which result in a crash of our testscript. This usually happens when we invoke the Ranorex.Core.Element.TryFindSingle method.

When I look in our NLog files which contain the ranorex nlog lines as well i found the following line close to the thread abort exception.
Ranorex.Core.Watchdog|Aborting thread 'System.Threading.Thread' due to timeout being reached.
Is there anything what we should consider when we invoke "TryFindSingle"- Method?

Edit:
What I forgot to mention: We are using ranorex 4.1.1 and the thread aborted exceptions only happen with win7 (under winxp we don't have those problems)

Re: Thread Aborted Exception

Posted: Thu Jan 30, 2014 3:48 pm
by Support Team
axelvs wrote:Is there anything what we should consider when we invoke "TryFindSingle"- Method?
No, and it should not make any difference which of the Find methods you use, either.

We had a customer reporting a similar issue, but were unable to reproduce the problem on our side and since then the customer did not experience the problem again. We would really like to dig into that problem, so we would like to ask you for the following information (either in this forum thread or via email to support_at_ranorex):
  • Is the exception always thrown for the same RanoreXPath or repository item?
  • Can you specify the RanoreXPath and timeout used in the TryFindSingle method?
  • Please provide a snapshot of the element you are searching for in the TryFindSingle call.
  • Is the TryFindSingle method invoked on the main thread, i.e. in a module used by the test suite?
  • Where do you call the TryFindSingle method? E.g. from the Run method of a module, a simple class method, a class constructor? Can you share a stack trace of the call?
Thank you for your help!

Regards,
Alex
Ranorex Team

Re: Thread Aborted Exception

Posted: Mon Oct 13, 2014 11:14 am
by i.matveev
The error is repeated periodically. I am ready to interoperate with a team of technical support for fault localization.

Re: Thread Aborted Exception

Posted: Mon Oct 13, 2014 11:22 am
by i.matveev
Text Error
  • Ошибка потокаSystem.Threading.ThreadAbortException: Поток находился в процессе прерывания.
    в System.Threading.Thread.SleepInternal(Int32 millisecondsTimeout)
    в Ranorex.Core.Element.TryFindInternal(RxPath path, Duration timeout, Boolean findSingle, IList`1& foundElements)
    в Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException, Duration effectiveTimeoutOverride)
    в Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException)
    в Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException)
Installed russian version of Ranorex

Re: Thread Aborted Exception

Posted: Mon Oct 13, 2014 3:13 pm
by i.matveev
more
  • Ошибка потокаSystem.Threading.ThreadAbortException: Поток находился в процессе прерывания.
    в Ranorex.Core.ElementEngine.ApplyGlueRules(Element element, GlueRuleExecutionState state)
    в Ranorex.Core.ElementEngine.ApplyGlueRules(Element element)
    в Ranorex.Core.Element.GetChildren(CacheSession session)
    в Ranorex.Core.Element.get_Children()
    в Ranorex.Core.RxPath.collectAxis(LocationStep step, Axis optimizedAxis, Element self, IList`1 elements, Boolean quitOnFirstGoodNode)
    в Ranorex.Core.RxPath.ApplyInternal(RxPath path, Element startElement, Duration timeout, Boolean findSingle)
    в Ranorex.Core.Element.TryFindInternal(RxPath path, Duration timeout, Boolean findSingle, IList`1& foundElements)
    в Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException, Duration effectiveTimeoutOverride)
    в Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException)
    в Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException)

Re: Thread Aborted Exception

Posted: Tue Oct 14, 2014 4:24 pm
by i.matveev
more
Поток находился в процессе прерывания.
Show/Hide Stacktrace
в System.Threading.Thread.SleepInternal(Int32 millisecondsTimeout)
в Ranorex.Core.Element.TryFindInternal(RxPath path, Duration timeout, Boolean findSingle, IList`1& foundElements)
в Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException,
Duration effectiveTimeoutOverride) в Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle,
Boolean throwException) в Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException)
в Ranorex.Core.Repository.RepoItemInfo.Exists[T](T& adapter) в Ranorex.Core.Repository.RepoItemInfo.Exists()

Re: Thread Aborted Exception

Posted: Wed Oct 15, 2014 3:53 pm
by Support Team
Hi Ivan,

In order to be able to analyze this issue may I ask you to enable the Ranorex internal logging mechanism?
To enable it just copy the attached NLog.txt file to the same directory where your Ranorex test exe resides in and chnage the ending from "txt" to "config".
When you start your test a log file named <NameOfYourExe>.log should be created. Please send me ([email protected]) or post the log file of a test run where you saw the issue.

Thanks,
Markus

Re: Thread Aborted Exception

Posted: Wed Oct 15, 2014 8:26 pm
by i.matveev
Sent log to mail. Waiting your answer. This question very critical for me. Thanx

Re: Thread Aborted Exception

Posted: Thu Oct 16, 2014 3:29 pm
by Support Team
Hi Ivan,

Thank you for the file, we will analyze it.

Regards,
Markus

Re: Thread Aborted Exception

Posted: Thu Oct 16, 2014 3:49 pm
by i.matveev
Thank you, Markus. How long?
I sent two files for analyze

Re: Thread Aborted Exception

Posted: Fri Nov 28, 2014 8:57 am
by Geci
Hello,
what is the status of the problem? In version 5.1.3.19973 there is this problem still. Unfortunately, you can not work like that :cry:

Der Thread wurde abgebrochen.
Show/Hide Stacktrace
bei Ranorex.Core.Testing.TestCase.Run(DataContext parentDataContext, Boolean childSkip) bei Ranorex.Core.Testing.TestSuite.Run(String runConfigName, String runLabel, Dictionary`2 parameters) bei Ranorex.Core.Testing.TestSuiteRunner.RunInternal(Type containerType, String testSuiteXml, RunParams rp)


Regards
GeCi

Re: Thread Aborted Exception

Posted: Mon Dec 01, 2014 1:58 pm
by Support Team
Hi GeCi,

The original problem should be fixed with Ranorex 5.2.1.

I am not sure if the error you are seeing is the same discussed in this thread, but this can easily be determined, just install 5.2.1 and ii the error should be gone,it was the same error :).
If not, please just send me the internal Ranorex log file of a test run where the error occurred.

Regards,
Markus