win32com Dispatch the 32 bit version of TestStand












0















I have a python script that connects to TestStand and retrieves certain data from a .seq (sequence) file.



import win32com.client
import pythoncom
TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
Seqfile = TestStandEngine .GetSequenceFileEx("Seq_File.seq")
Main = Seqfile.GetSequenceByName("MainSequence") #Get's the main sequence of the file


I had installed both the x32 and x64 versions of Test Stand 2014, and the script ran just fine.
After uninstalling the x64 version (because it was not needed),the script now gives this error:



Traceback (most recent call last):
File "C:tsMain.py", line 9, in <module>
TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
File "C:LegacyAppPython_2.7libsite-packageswin32comclient__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 114, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
com_error: (-2147221005, 'Invalid class string', None, None)


After doing some research , I think I know what causes the problem but I couldn't find any way to fix it.



-The Python instalation on my computer is 32 bit



>>> import platform
>>> platform.architecture()
('32bit', 'WindowsPE')


-The only installed Test Stand on my computer is the 32 bit version.



-The OS : Windows x64 bit OS



Here's my guess: I think that when it Dispatches the Teststand.Engine it tries to use the x64 version of it that is no longer installed;
I've tried by adding the clsctx parameter, but same result:



win32com.client.Dispatch("TestStand.Engine",clsctx=pythoncom.CLSCTX_LOCAL_SERVER)


Is there any way to 'force' it to launch the 32 bit version ? If the TestStand is on 32bit and Python is on 32bit shouldn't it return a 32bit COM object that should work with python 32bit?



Update: So after running this in PowerShell it returned a list of all valid names of COM but 'Teststand.Engine' is not on the list. The only TestStand related object in the list is TestStand.ExLauncher (which I can dispatch, but it does not have the same attributes/use as the TestStand.Engine










share|improve this question



























    0















    I have a python script that connects to TestStand and retrieves certain data from a .seq (sequence) file.



    import win32com.client
    import pythoncom
    TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
    Seqfile = TestStandEngine .GetSequenceFileEx("Seq_File.seq")
    Main = Seqfile.GetSequenceByName("MainSequence") #Get's the main sequence of the file


    I had installed both the x32 and x64 versions of Test Stand 2014, and the script ran just fine.
    After uninstalling the x64 version (because it was not needed),the script now gives this error:



    Traceback (most recent call last):
    File "C:tsMain.py", line 9, in <module>
    TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
    File "C:LegacyAppPython_2.7libsite-packageswin32comclient__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
    File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 114, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
    File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
    com_error: (-2147221005, 'Invalid class string', None, None)


    After doing some research , I think I know what causes the problem but I couldn't find any way to fix it.



    -The Python instalation on my computer is 32 bit



    >>> import platform
    >>> platform.architecture()
    ('32bit', 'WindowsPE')


    -The only installed Test Stand on my computer is the 32 bit version.



    -The OS : Windows x64 bit OS



    Here's my guess: I think that when it Dispatches the Teststand.Engine it tries to use the x64 version of it that is no longer installed;
    I've tried by adding the clsctx parameter, but same result:



    win32com.client.Dispatch("TestStand.Engine",clsctx=pythoncom.CLSCTX_LOCAL_SERVER)


    Is there any way to 'force' it to launch the 32 bit version ? If the TestStand is on 32bit and Python is on 32bit shouldn't it return a 32bit COM object that should work with python 32bit?



    Update: So after running this in PowerShell it returned a list of all valid names of COM but 'Teststand.Engine' is not on the list. The only TestStand related object in the list is TestStand.ExLauncher (which I can dispatch, but it does not have the same attributes/use as the TestStand.Engine










    share|improve this question

























      0












      0








      0








      I have a python script that connects to TestStand and retrieves certain data from a .seq (sequence) file.



      import win32com.client
      import pythoncom
      TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
      Seqfile = TestStandEngine .GetSequenceFileEx("Seq_File.seq")
      Main = Seqfile.GetSequenceByName("MainSequence") #Get's the main sequence of the file


      I had installed both the x32 and x64 versions of Test Stand 2014, and the script ran just fine.
      After uninstalling the x64 version (because it was not needed),the script now gives this error:



      Traceback (most recent call last):
      File "C:tsMain.py", line 9, in <module>
      TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
      File "C:LegacyAppPython_2.7libsite-packageswin32comclient__init__.py", line 95, in Dispatch
      dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
      File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 114, in _GetGoodDispatchAndUserName
      return (_GetGoodDispatch(IDispatch, clsctx), userName)
      File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 91, in _GetGoodDispatch
      IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
      com_error: (-2147221005, 'Invalid class string', None, None)


      After doing some research , I think I know what causes the problem but I couldn't find any way to fix it.



      -The Python instalation on my computer is 32 bit



      >>> import platform
      >>> platform.architecture()
      ('32bit', 'WindowsPE')


      -The only installed Test Stand on my computer is the 32 bit version.



      -The OS : Windows x64 bit OS



      Here's my guess: I think that when it Dispatches the Teststand.Engine it tries to use the x64 version of it that is no longer installed;
      I've tried by adding the clsctx parameter, but same result:



      win32com.client.Dispatch("TestStand.Engine",clsctx=pythoncom.CLSCTX_LOCAL_SERVER)


      Is there any way to 'force' it to launch the 32 bit version ? If the TestStand is on 32bit and Python is on 32bit shouldn't it return a 32bit COM object that should work with python 32bit?



      Update: So after running this in PowerShell it returned a list of all valid names of COM but 'Teststand.Engine' is not on the list. The only TestStand related object in the list is TestStand.ExLauncher (which I can dispatch, but it does not have the same attributes/use as the TestStand.Engine










      share|improve this question














      I have a python script that connects to TestStand and retrieves certain data from a .seq (sequence) file.



      import win32com.client
      import pythoncom
      TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
      Seqfile = TestStandEngine .GetSequenceFileEx("Seq_File.seq")
      Main = Seqfile.GetSequenceByName("MainSequence") #Get's the main sequence of the file


      I had installed both the x32 and x64 versions of Test Stand 2014, and the script ran just fine.
      After uninstalling the x64 version (because it was not needed),the script now gives this error:



      Traceback (most recent call last):
      File "C:tsMain.py", line 9, in <module>
      TestStandEngine = win32com.client.Dispatch("TestStand.Engine")
      File "C:LegacyAppPython_2.7libsite-packageswin32comclient__init__.py", line 95, in Dispatch
      dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
      File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 114, in _GetGoodDispatchAndUserName
      return (_GetGoodDispatch(IDispatch, clsctx), userName)
      File "C:LegacyAppPython_2.7libsite-packageswin32comclientdynamic.py", line 91, in _GetGoodDispatch
      IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
      com_error: (-2147221005, 'Invalid class string', None, None)


      After doing some research , I think I know what causes the problem but I couldn't find any way to fix it.



      -The Python instalation on my computer is 32 bit



      >>> import platform
      >>> platform.architecture()
      ('32bit', 'WindowsPE')


      -The only installed Test Stand on my computer is the 32 bit version.



      -The OS : Windows x64 bit OS



      Here's my guess: I think that when it Dispatches the Teststand.Engine it tries to use the x64 version of it that is no longer installed;
      I've tried by adding the clsctx parameter, but same result:



      win32com.client.Dispatch("TestStand.Engine",clsctx=pythoncom.CLSCTX_LOCAL_SERVER)


      Is there any way to 'force' it to launch the 32 bit version ? If the TestStand is on 32bit and Python is on 32bit shouldn't it return a 32bit COM object that should work with python 32bit?



      Update: So after running this in PowerShell it returned a list of all valid names of COM but 'Teststand.Engine' is not on the list. The only TestStand related object in the list is TestStand.ExLauncher (which I can dispatch, but it does not have the same attributes/use as the TestStand.Engine







      python com dispatch teststand






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 24 '18 at 11:26









      HaRHaR

      390111




      390111
























          2 Answers
          2






          active

          oldest

          votes


















          0














          Solved it by reinstalling TestStand. (I knew that reinstalling would solve the problem but I was hoping I didn't have to reinstall it since it would've affect multiple configs)



          The problem was that when I uninstalled the TestStand x64 version, the uninstaller thought that I was going to completely uninstall TestStand and most probably deleted some registry keys containing the directions for the 'TestStand.Engine'
          After reinstalling the x32 bit version it works fine.






          share|improve this answer































            0














            Have you try using the version dependent interface instead ie



            TestStandEngine = win32com.client.Dispatch("TestStand.Engine.1")





            share|improve this answer
























            • Hello. Thank you for your reply . No at that time I don't think that I've tried that. I've got a lit of all COM objects using this Powershell Code and the only occurrence of TestStand was not related to the TestStand.Engine. The issue was fixed by re-installing TestStand. Thank you again for this suggestion :)

              – HaR
              Nov 22 '18 at 10:38











            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50508191%2fwin32com-dispatch-the-32-bit-version-of-teststand%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Solved it by reinstalling TestStand. (I knew that reinstalling would solve the problem but I was hoping I didn't have to reinstall it since it would've affect multiple configs)



            The problem was that when I uninstalled the TestStand x64 version, the uninstaller thought that I was going to completely uninstall TestStand and most probably deleted some registry keys containing the directions for the 'TestStand.Engine'
            After reinstalling the x32 bit version it works fine.






            share|improve this answer




























              0














              Solved it by reinstalling TestStand. (I knew that reinstalling would solve the problem but I was hoping I didn't have to reinstall it since it would've affect multiple configs)



              The problem was that when I uninstalled the TestStand x64 version, the uninstaller thought that I was going to completely uninstall TestStand and most probably deleted some registry keys containing the directions for the 'TestStand.Engine'
              After reinstalling the x32 bit version it works fine.






              share|improve this answer


























                0












                0








                0







                Solved it by reinstalling TestStand. (I knew that reinstalling would solve the problem but I was hoping I didn't have to reinstall it since it would've affect multiple configs)



                The problem was that when I uninstalled the TestStand x64 version, the uninstaller thought that I was going to completely uninstall TestStand and most probably deleted some registry keys containing the directions for the 'TestStand.Engine'
                After reinstalling the x32 bit version it works fine.






                share|improve this answer













                Solved it by reinstalling TestStand. (I knew that reinstalling would solve the problem but I was hoping I didn't have to reinstall it since it would've affect multiple configs)



                The problem was that when I uninstalled the TestStand x64 version, the uninstaller thought that I was going to completely uninstall TestStand and most probably deleted some registry keys containing the directions for the 'TestStand.Engine'
                After reinstalling the x32 bit version it works fine.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 29 '18 at 11:25









                HaRHaR

                390111




                390111

























                    0














                    Have you try using the version dependent interface instead ie



                    TestStandEngine = win32com.client.Dispatch("TestStand.Engine.1")





                    share|improve this answer
























                    • Hello. Thank you for your reply . No at that time I don't think that I've tried that. I've got a lit of all COM objects using this Powershell Code and the only occurrence of TestStand was not related to the TestStand.Engine. The issue was fixed by re-installing TestStand. Thank you again for this suggestion :)

                      – HaR
                      Nov 22 '18 at 10:38
















                    0














                    Have you try using the version dependent interface instead ie



                    TestStandEngine = win32com.client.Dispatch("TestStand.Engine.1")





                    share|improve this answer
























                    • Hello. Thank you for your reply . No at that time I don't think that I've tried that. I've got a lit of all COM objects using this Powershell Code and the only occurrence of TestStand was not related to the TestStand.Engine. The issue was fixed by re-installing TestStand. Thank you again for this suggestion :)

                      – HaR
                      Nov 22 '18 at 10:38














                    0












                    0








                    0







                    Have you try using the version dependent interface instead ie



                    TestStandEngine = win32com.client.Dispatch("TestStand.Engine.1")





                    share|improve this answer













                    Have you try using the version dependent interface instead ie



                    TestStandEngine = win32com.client.Dispatch("TestStand.Engine.1")






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 21 '18 at 20:15









                    DawsDaws

                    11




                    11













                    • Hello. Thank you for your reply . No at that time I don't think that I've tried that. I've got a lit of all COM objects using this Powershell Code and the only occurrence of TestStand was not related to the TestStand.Engine. The issue was fixed by re-installing TestStand. Thank you again for this suggestion :)

                      – HaR
                      Nov 22 '18 at 10:38



















                    • Hello. Thank you for your reply . No at that time I don't think that I've tried that. I've got a lit of all COM objects using this Powershell Code and the only occurrence of TestStand was not related to the TestStand.Engine. The issue was fixed by re-installing TestStand. Thank you again for this suggestion :)

                      – HaR
                      Nov 22 '18 at 10:38

















                    Hello. Thank you for your reply . No at that time I don't think that I've tried that. I've got a lit of all COM objects using this Powershell Code and the only occurrence of TestStand was not related to the TestStand.Engine. The issue was fixed by re-installing TestStand. Thank you again for this suggestion :)

                    – HaR
                    Nov 22 '18 at 10:38





                    Hello. Thank you for your reply . No at that time I don't think that I've tried that. I've got a lit of all COM objects using this Powershell Code and the only occurrence of TestStand was not related to the TestStand.Engine. The issue was fixed by re-installing TestStand. Thank you again for this suggestion :)

                    – HaR
                    Nov 22 '18 at 10:38


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f50508191%2fwin32com-dispatch-the-32-bit-version-of-teststand%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

                    How to fix TextFormField cause rebuild widget in Flutter