Forum Discussion

Philip_Baird's avatar
Philip_Baird
Community Expert
11 years ago

Discrepencies around COM Object registration

Hi, I am currently writing a C# Library to manage Test Execution using the Test Execute COM Object and I have a concern on the COM registeration.

 


I have both Test Complete and Test Execute installed on my machine, and the documentation here indicates there should be a "TestExecute Library" for Test Execute, i.e.




"Find TestExecute Library (TypeLib Version: 10) in the list of available components and add this library to your project.


Note: TestExecute is based on the TestExecute platform and has the same library name (TestExecute Library). To make certain that you selected the item for TestExecute, check the value of the COM page’s Path column. It should specify the path to TestExecute.exe."





However when I first attempted to add the reference, I only had a "TestComplete Library" for Test Complete.


 


I then attempted to registere Test Execute using:


 


"E:\DevApps\SmartBear\TestExecute 10\Bin\TestExecute.exe" /regserver


 


I now still only have a single "TestComplete Library" which now points to Test Execute having seemingly over written the Test Complete one.


 


Also, the the rest of the Test Complete Objects now have a mixture of references, some to Test Execute and some to Test Complete, as shown:








Is this expected behaviour?



My concerns are:


 


1. I never had a "TestExecute Library" available, even though I had Test Execute installed, should I have had?


2. Registering Test Execute has overwritten Test Complete, is this expected?


3. My machine is now in a state that isn't even remotely close to that described in the documentation, is the documentation correct? is there something I need to do to remedy this?


 


Regards,


Phil Baird






  • Hi Phil,


     


    There is no TestExecute library. You need to add the TestComplete library which refers to TestExecute, like it's listed in the article.


    We will correct the information in our documentation.


     




  • hlalumiere's avatar
    hlalumiere
    Regular Contributor
    You do not need to worry about COM registration at all to be honest, unless your installation was damaged. To get the reference to TestComplete or TestExecute, reference the .exe. Visual studio will generate an Interop DLL when you build. Copy that DLL to the output, and then reference it instead of the exe from your app. Now you can develop your app on any machine no matter if it has TestComplete installed or not. When you actually instanciate check for an exception when creating the TestComplete.Application object. You can trap if something is wrong at runtime.



    In VB you could also use late binding to abstract it all away. But C# doesn't support late binding pre-4.0. In 4.0+ you can use late binding with the poorly-named "dynamic" keyword. (I say poorly named because both c# and vb are static languages, there is no dynamic typing...)
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)


    Hi Phil,


     


    There is no TestExecute library. You need to add the TestComplete library which refers to TestExecute, like it's listed in the article.


    We will correct the information in our documentation.


     




  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Tanya, thanks for that.

     


    Just to clarify, is there an issue around only having a single "TestComplete Library" registered?


     


    The first part of the documentation seems to indicate there should be multiple occurances of "TestComplete Library" with one each for TestComplete.exe and TestExecute.exe


     


    Regards,


    Phil Baird

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Phil,


     


    Sorry for not getting back to you earlier.


    I believe that there should be two libraries. Do you see the only one on your computer? Are you able to access the TestExecute COM object after adding the TestComplete library?

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Tanya, I can confirm I only have a single instance of "TestComplete Library" registered.

     


    Searching the registry for "TestComplete Library" returns the following keys:


     


    HKEY_CLASSES_ROOT\TypeLib\{95F851DF-3C2C-493F-8E02-70932B672D5B}\a.0


    HKEY_CLASSES_ROOT\Wow6432Node\TypeLib\{95F851DF-3C2C-493F-8E02-70932B672D5B}\a.0


    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{95F851DF-3C2C-493F-8E02-70932B672D5B}\a.0


    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\TypeLib\{95F851DF-3C2C-493F-8E02-70932B672D5B}\a.0


    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\TypeLib\{95F851DF-3C2C-493F-8E02-70932B672D5B}\a.0


     


    all of which have the same GUID.


     


    I have also noticed the values associated with these registry entries change depending on which of Test Complete or Test Execute ran last.


     


    i.e. If I run Test Execute, the value of \a.0\0\win32 is set to E:\DevApps\SmartBear\TestExecute 10\Bin\TestExecute.exe


     


    If I then run Test Complete, the value of \a.0\0\win32 is set to E:\DevApps\SmartBear\TestComplete 10\Bin\TestComplete.exe


     


    I am not sure exactly what is happening here but it seems rather strange behaviour.


     


    Regards,


    Phil Baird

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Phil,


     


    I agree with you that this is very weird behavior. Could you please try reinstalling TestExecute, remove its folder (where it was installed) and install anew? Perhaps, some modules weren't installed on your computer.


     

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Tanya, I have tried re-installing Test Execute as you suggested, by first un-installing Test Execute.

     


    However, I am now unable to install Test Execute as the installer thinks Test Execute is still installed:







    When any option is selected I get the following Feature transfer error:








    Could you please provide some information on how I might remedy this.


     


    Regards,


    Phil Baird