05-24-2018 03:01 AM
This is very strange since last night it was working properly , basically I'm trying to connect to TesStand and read a .seq file, but today for some reason it stopped working.
So I'm trying with the example code given : Here
And here's the code:
import win32com.client import pythoncom TSEngine = win32com.client.Dispatch("TestStand.Engine") Seqfile = TSEngine.GetSequenceFileEx("SeqFile.seq") Main = Seqfile.GetSequenceByName("MainSequence")
It's a simple piece of code that stops right at :
win32com.client.Dispatch("TestStand.Engine")
And it gives me this error:
Traceback (most recent call last): File "C:\ts\Main.py", line 9, in <module> TSEngine = win32com.client.Dispatch("TestStand.Engine") File "C:\LegacyApp\Python_2.7\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "C:\LegacyApp\Python_2.7\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "C:\LegacyApp\Python_2.7\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) com_error: (-2147221005, 'Invalid class string', None, None)
I'm using TestStand Engine Version 2014 SP1 (14.0.1.103) 32-bit and Python on '2.7.5 [MSC v.1500 32 bit (Intel)]'
The strange things is that the code was working perfectly until today.
Thank you!
Solved! Go to Solution.
05-24-2018 03:17 AM
Update: Apparently I've had a 64x bit version that I was uninstalled recently,
Is it possible to specify to win32com.client.Dispatch("TestStand.Engine") to use the x32 bit version of TestStand?(Since it's the only one left on my PC)
Thank you !
05-25-2018 12:17 PM
Hey RaduH!
Are you currently able to run TestStand not from Python? As in, does running a sequence file execute successfully?
I'm curious if something may have been corrupted upon the uninstall of the 64 bit version of TestStand. If you aren't able to run TestStand successfully, we might start with a repair of the software.
05-26-2018 03:29 AM
Hello,
I am able run sequences successfully everything works just fine in TestStand.
I am thinking the same thing, it might have removed the COM from the registry key thinking it would be uninstalled completely.
I will try to reinstall it but I was hoping not to.
Thank you.
05-29-2018 07:16 AM - edited 05-29-2018 07:17 AM
You were right , something was corrupted during the uninstall, I think the uninstaller is written in such a way to remove all TestStand related data from the computer, and most probably deleted the COM object ('TestStand.Engine') or removed the link to it from the registry.
I've re-installed TestStand and it works fine now.
05-29-2018 08:22 AM
Ah, glad to hear you were able to get things back up and running! Thanks for marking a solution, happy TestStand-ing!