Thread Aborted Exception

Class library usage, coding and language questions.
axelvs
Posts: 4
Joined: Wed Dec 05, 2012 10:42 am

Thread Aborted Exception

Post by axelvs » Thu Jan 30, 2014 11:26 am

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)

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Thread Aborted Exception

Post by Support Team » Thu Jan 30, 2014 3:48 pm

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
.
Image

i.matveev
Posts: 40
Joined: Thu Apr 11, 2013 1:10 pm

Re: Thread Aborted Exception

Post by i.matveev » Mon Oct 13, 2014 11:14 am

The error is repeated periodically. I am ready to interoperate with a team of technical support for fault localization.

i.matveev
Posts: 40
Joined: Thu Apr 11, 2013 1:10 pm

Re: Thread Aborted Exception

Post by i.matveev » Mon Oct 13, 2014 11:22 am

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

i.matveev
Posts: 40
Joined: Thu Apr 11, 2013 1:10 pm

Re: Thread Aborted Exception

Post by i.matveev » Mon Oct 13, 2014 3:13 pm

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)

i.matveev
Posts: 40
Joined: Thu Apr 11, 2013 1:10 pm

Re: Thread Aborted Exception

Post by i.matveev » Tue Oct 14, 2014 4:24 pm

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()

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Thread Aborted Exception

Post by Support Team » Wed Oct 15, 2014 3:53 pm

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
Attachments
NLog.txt
(1.01 KiB) Downloaded 133 times
.
Image

i.matveev
Posts: 40
Joined: Thu Apr 11, 2013 1:10 pm

Re: Thread Aborted Exception

Post by i.matveev » Wed Oct 15, 2014 8:26 pm

Sent log to mail. Waiting your answer. This question very critical for me. Thanx

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Thread Aborted Exception

Post by Support Team » Thu Oct 16, 2014 3:29 pm

Hi Ivan,

Thank you for the file, we will analyze it.

Regards,
Markus
.
Image

i.matveev
Posts: 40
Joined: Thu Apr 11, 2013 1:10 pm

Re: Thread Aborted Exception

Post by i.matveev » Thu Oct 16, 2014 3:49 pm

Thank you, Markus. How long?
I sent two files for analyze

Geci
Posts: 15
Joined: Fri Sep 06, 2013 1:16 pm

Re: Thread Aborted Exception

Post by Geci » Fri Nov 28, 2014 8:57 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Thread Aborted Exception

Post by Support Team » Mon Dec 01, 2014 1:58 pm

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
.
Image