locked
Unit testing Office.PowerPoint.Interop RRS feed

  • Question

  • I am trying to write unit test against the PowerPoint interop.  My tests will open a new PowerPoint application my add presentation and slides depending on the test then closes the application.  I have several test that run in my test class that follow this pattern.  Sometimes they all run without issue but usually at leat one test will get the following COM exception:

    Result Message: 
    Test method threw exception:
    System.Runtime.InteropServices.COMException: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))
    Result StackTrace: 
    at Microsoft.Office.Interop.PowerPoint._Application.set_Visible(MsoTriState Visible)

    I  tried removing line that sets the application.Visible property tried setting it to msoTrue.  Sometimes the test run usually at least one will get the error above.  If I run the test that fails by itself it always passes.  How can I get around this problem?

    Saturday, June 14, 2014 5:41 AM

Answers

  • Hi titan1968mc,

    I have several test that run in my test class that follow this pattern.  Sometimes they all run without issue but usually at leat one test will get the following COM exception

    System.Runtime.InteropServices.COMException: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

    Just to make this issue clearly, whether the failed test is the same one when it failed? If they worked well when you run them one by one, I doubt that it is not this test's issue, I mean that one possible reason is that others tests impact this specific test.

    I have no your test projects, so I just give you a simple sample, if one test changed a data table, your another test still use this table’ data, but we know that the data has been changed, so the unit test would have different results.

    This is just a sample, I doubt that your test has a specific requirement like the running order. Maybe you could your test to the ordered tests, and then change the tests in ordered, so we could narrow down this issue. Or you could run few (two) tests (include the failed test) one time, and check whether two tests have the conflict.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, June 17, 2014 9:25 AM

All replies

  • Hi titan1968mc,

    I have several test that run in my test class that follow this pattern.  Sometimes they all run without issue but usually at leat one test will get the following COM exception

    System.Runtime.InteropServices.COMException: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

    Just to make this issue clearly, whether the failed test is the same one when it failed? If they worked well when you run them one by one, I doubt that it is not this test's issue, I mean that one possible reason is that others tests impact this specific test.

    I have no your test projects, so I just give you a simple sample, if one test changed a data table, your another test still use this table’ data, but we know that the data has been changed, so the unit test would have different results.

    This is just a sample, I doubt that your test has a specific requirement like the running order. Maybe you could your test to the ordered tests, and then change the tests in ordered, so we could narrow down this issue. Or you could run few (two) tests (include the failed test) one time, and check whether two tests have the conflict.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, June 17, 2014 9:25 AM
  • Hi titan1968mc,

    Any update? Could you get the useful information from my reply?

    Would you mind letting us know the latest information about this issue?

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, June 23, 2014 2:27 AM