Error -2147352567 When Configuring TestStand Step Setting Through Python

Updated Jun 9, 2024

Reported In

Software

  • TestStand

Programming Language

  • Python

Issue Details

I am configuring Call Executable step properties in TestStand through Python, and I am facing the error below.
Python.png
How can I solve this error?

Solution

The error you’re encountering occurs because the command is trying to set a string value but is unable to access the item. It is most likely because you are not referring to the property that you are trying to configure correctly.

As an example, referring to the above error image, the code below seems like it is intended to set the input file path of the Standard Input properties for the Call Executable step.
New_Step.AsPropertyObject().SetValString("StdInput", 0, "\"C:\\Users\\abc.exe\"")

To correctly specify the input file path, use StdInput.Source instead of StdInput. StdInput.Source represents the standard input string, expression, or file pathname. 

For more information on the step type in the TestStand API, refer to the TestStand API Reference help.