locked
Error calling Initialization method for test class xxx.Tests.DownloadAuthentication: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component. RRS feed

  • Question

  • Hello,

    I've posted that like a months ago while using Beta 1, in some situations  where a failure occurs in TestInitialize or ClassInitialize methods or the test is stopped at that stage, QTAgent32 start consuming like 100 percet and it looks hangs. You fixed that but now the situations is that on second run after that condition happens (fauilure in TestInitialize  or ClassInitialize ) the following error is again triggering and i need to restart QTAgent32  so that i can run the tests again:

    Error calling Initialization method for test class xxx.Tests.DownloadAuthentication: System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

    Error Stack Trace:

    Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IRPFPlayback.SetSkipStepEventName(String skipStepEventName)
    Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.InitPlayback()
    Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize()

     

     

     

     

     

    Tuesday, March 30, 2010 8:55 AM

Answers

  • Can you try these and see if it solves your problem

    1. Tools Menu -> Options -> Test Execution -> Uncheck the checkbox "Keep test execution engine running between test runs"

    2. Do Playback.Cleanup() in the TestCleanup/ClassCleanup methods as well as in the TestInitialize/ClassInitialize in a finally clause after the init actions are done, just like below

    finally
                {
                    if (Playback.IsInitialized)
                    {
                        Playback.Cleanup();
                    }
                }
    Tuesday, March 30, 2010 6:19 PM
    Moderator

All replies

  • Can you try these and see if it solves your problem

    1. Tools Menu -> Options -> Test Execution -> Uncheck the checkbox "Keep test execution engine running between test runs"

    2. Do Playback.Cleanup() in the TestCleanup/ClassCleanup methods as well as in the TestInitialize/ClassInitialize in a finally clause after the init actions are done, just like below

    finally
                {
                    if (Playback.IsInitialized)
                    {
                        Playback.Cleanup();
                    }
                }
    Tuesday, March 30, 2010 6:19 PM
    Moderator
  • For now option 1 is just fine, I haven't tested enough but will let you know whether later i would need to use and 2 in addition.
    Tuesday, April 6, 2010 1:28 PM
  • Option 1 worked for me also.

     

    Thanks

    Tuesday, May 4, 2010 3:59 PM
  • Vishnu,

    I am encountering the same problem except in a MTM environment with Test Agent machines. Tests that time out after 20 minutes will occasionally lock up the Test Agent and all tests after will return a failure of System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

    I am calling Cleanup in a try block but does not solve the problem since IsInitialized is false and Cleanup does not actually get called.

    I need this to work in a Test Agent environment and not just VS2010. My only current idea is a separate program to monitor the test agent and manually reset it. If you are aware of a bug within the execution engine, is there currently a timeline when to expect the fix?

    QTAgent32.exe is the same process on a local test run as when it's installed on a remote machine, so I think disabling it between test runs when it's waiting for dispatches remotely simply will not work.

    Thank you for an advice you can provide.

     


    Martin - iQmetrix
    Friday, June 3, 2011 4:54 PM