Ignore ThreadAbortException

1 posts, 0 answers
  1. Alex
    Alex avatar
    8 posts
    Member since:
    May 2009

    Posted 29 Jun 2010 Link to this post

    After every test I run with WebAii as soon as I close the browser or clean up the test I get the following exception :

    ---- UNHANDLED EXCEPTION ----
    Thread Name: RemotedAsyncCommandListener
    System.Threading.ThreadAbortException: Thread was being aborted.
       at ArtOfTest.WebAii.Messaging.Process.BrowserRemoted.AsyncListener()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()


    I get this even though the test itself has passed.

    I would like to hide this exception or at least not display in the console.writeline as it suggests the test has failed when it has not.

    I have tried playing with various settings including lots of configurations like Initialize(settings, new TestContextWriteLine(WriteLine));

    I have also tried catching the ThreadAbortException but it seems this is already being caught inside the WebAii internals and then the above log gets written each time.
Back to Top