Re: RE: Calling python script from Test Complete
I'm trying to run a python script from TestComplete, and am having a problem. I tried following the instructions within a previous discussion https://community.smartbear.com/t5/TestComplete-General-Discussions/Calling-python-script-from-Test-.... However, I keep getting an error, "TypeError: 'IDispatchIndexedPropertyWrapper' object is not callable". My python script does have an argument that is passing a filepath to the script. I am trying to run:
Sys.OleObject("WScript.SHell").Run("C:\\Python37\\python.exe '<Path to script>.py' -p '<Path to input file>'")
Do you have any suggestions?
I am running TestComplete 14.1, and have tried referencing the python installed on the system (C:\\Python37\\python.exe) and the python that is part of TestComplete (C:\\Program Files (x86)\\SmartBear\\TestComplete 14\\x64\\Bin\\Extensions\\Python\\Python36\\python.exe)
Solved! Go to Solution.
My problem ended up being that I was using parentheses, but I should have been using brackets for the Sys.OleObject.
DOES NOT WORK
Sys.OleObject("WScript.Shell").Run("C:\\Python37\\python.exe '<Path to script>.py' -p '<Path to input file>'")
Sys.OleObject["WScript.Shell"].Run("C:\\Python37\\python.exe '<Path to script>.py' -p '<Path to input file>'")